[R] How to change the scale of the Y axis?

2011-10-07 Thread feargalr
I am currently trying to create 3 histograms from 3 sets of data and in order to compare them I need them all to have a common scale, the Y axis is the only place its a problem, as one histogram only goes up to 4, another 5, and another 7 on the Y axis and obviously they all need to be in the same

Re: [R] How to write a list object's name to a new dataframe in that list object

2011-10-07 Thread Bert Gunter
SImpler: for(nm in names(L) ) L[[nm]] [[nm]] <- nm However, note that you could also attach the name to each data frame as a, say, "name" attribute and avoid the extra column. -- Bert On Fri, Oct 7, 2011 at 8:42 PM, R. Michael Weylandt < michael.weyla...@gmail.com> wrote: > It's inefficient b

[R] Generalized Additive Models: How to create publication-ready regression tables

2011-10-07 Thread davidyeager
Hi - I have a series of 9 GAM regressions with about 5 parametric effects and three non-parametric effects in each. What is a good library or command for turning GAM outputs into publication-ready regression tables? I tried apsrtable and the mtable command in memisc but neither seemed to work

[R] Strange behaviour with Homals

2011-10-07 Thread marco stamazza
Dear R users and experts, I am using the package Homals to perform categorical PCA on some survey data. The documentation is a bit obscure, however, I followed the examples. X is a matrix with ordinal 1-5 Likert scale entries on 24 questions from about 2500 respondents. So I run X.nlpc = homal

Re: [R] How to write a list object's name to a new dataframe in that list object

2011-10-07 Thread R. Michael Weylandt
It's inefficient but try this: Suppose your list is L: mapply(function(x,y) cbind(x, data.frame(NAME=rep(y,NROW(x, L, names(L), simplify = F) Code is untested however - let me know if this doesn't work and I'll get to a computer and clean it up. Michael Weylandt On Oct 7, 2011, at 11:1

[R] How to write a list object's name to a new dataframe in that list object

2011-10-07 Thread Mark Na
Hello R-helpers, I have a list that only contains dataframes. Each element of the list (i.e., each dataframe) has a unique name ("one" through "ten"). I wish to add a new column (called "NAME") to each list element (i.e each datarame) and I want that column to contain the name of it's list element

Re: [R] How to change the scale of the Y axis?

2011-10-07 Thread Pete Brecknock
feargalr wrote: > > I am currently trying to create 3 histograms from 3 sets of data and in > order to compare them I need them all to have a common scale, the Y axis > is the only place its a problem, as one histogram only goes up to 4, > another 5, and another 7 on the Y axis and obviously they

Re: [R] Wide to long form conversion

2011-10-07 Thread Gang Chen
David, thanks a lot for the code! I've learned quite a bit from all the generous help... Gang On Fri, Oct 7, 2011 at 1:37 PM, David Winsemius wrote: > > On Oct 7, 2011, at 1:30 PM, David Winsemius wrote: > >> >> On Oct 7, 2011, at 7:40 AM, Gang Chen wrote: >> >>> Jim, I really appreciate your he

Re: [R] gefp() boundaries?

2011-10-07 Thread Achim Zeileis
On Fri, 7 Oct 2011, bonda wrote: Well, I am still confused... shouldn't the "made-by-hands"-process (correctly constructed, of course) and the gefp()-process be similar? Correctly constructed yes. And if unsure, just read the source code (as previously suggested): it's open! For the case of

Re: [R] loess question

2011-10-07 Thread Bert Gunter
Below. -- Bert On Fri, Oct 7, 2011 at 1:09 PM, Saurav Pathak wrote: > Hi All, > > I am trying to use loess to smooth a 2D image, and also obtain the standard > error for every pixel. I see that the standard error does not make sense. > For example, running the following: > > library(stats) >

Re: [R] Find a particular point on a curve

2011-10-07 Thread David Winsemius
On Oct 7, 2011, at 5:06 PM, Joanie wrote: Here is a sample of my data: time temperature 40717.0140390 37.5 40717.0140510 37.5 40717.0519680 37.6 40717.0519790 37.6 40717.0520020 37.6 40717.0520140 37.6 After making that data into a dataframe named "dat" > plo

[R] round() and negative digits

2011-10-07 Thread Carl Witthoft
Just wondering here -- I tested and found to my delight that % round(325.4,-2) [1] 300 gave me exactly what I would have expected (and wanted). Since it's not explicitly mentioned in the documentation that negative 'digits' is allowed, I just wanted to ask whether this behavior is intentiona

Re: [R] Find a particular point on a curve

2011-10-07 Thread David Winsemius
On Oct 7, 2011, at 5:06 PM, Joanie wrote: Here is a sample of my data: time temperature 40717.0140390 37.5 40717.0140510 37.5 40717.0519790 37.6 40717.0520020 37.6 40717.0520140 37.6 So your starting temp is different than your ending temp. How do you want t

Re: [R] Find a particular point on a curve

2011-10-07 Thread Joanie
Here is a sample of my data: time temperature 40717.0140390 37.5 40717.0140510 37.5 40717.0140620 37.5 40717.0140740 37.5 40717.0140970 37.5 40717.0141200 37.5 40717.0141320 37.5 40717.0141550 37.5 40717.0141670 37.5 40717.0141780 37.5 40717.0141900 37.5 407

Re: [R] Expand dataframe according to limits defined per row

2011-10-07 Thread Dennis Murphy
Here's one way to do it with the plyr package: library('plyr') f <- function(df) with(df, data.frame(B = B, E = seq(C, D))) ddply(d, 'A', f) A corresponding solution with the data.table package would be library('data.table') dt <- data.table(d, key = 'A') dt[, list(B, E = seq(C, D)), by = 'A']

Re: [R] gamm: problems with corCAR1()

2011-10-07 Thread Simon Wood
corCAR1 doesn't allow you to have the same value of Week appearing more than once within a level of Treatment. Maybe average these replicates, if that makes sense in this context? The singularity problem relates to lack of identifiability in the GAM structure. Treatment appears too many times!

[R] loess question

2011-10-07 Thread Saurav Pathak
Hi All, I am trying to use loess to smooth a 2D image, and also obtain the standard error for every pixel. I see that the standard error does not make sense. For example, running the following: library(stats) x <- array(c(1:100), dim=c(100,100)) y <- t(x) v <- exp(-((x-50)^2+(y-50)^2)/30^2)

Re: [R] Merge dataframes

2011-10-07 Thread David Winsemius
On Oct 7, 2011, at 9:34 AM, jdanielnd wrote: Hello, I am having some problems to use the 'merge' function. I'm not sure if I got its working right. What I want to do is: 1) Suppose I have a dataframe like: height width 11.12.3 22.1

Re: [R] Find a particular point on a curve

2011-10-07 Thread David Winsemius
On Oct 7, 2011, at 11:54 AM, Joanie wrote: Hi, my question is really precise. I'm interested in drops of stomacal temperature (of seal pups) following milk ingestion. Temperature starts at an average of 37.8oC (sd=0.2) and drops rapidly to around 36.0oC and then stabilizes slowly to a te

Re: [R] Merge dataframes

2011-10-07 Thread jdanielnd
I'm not sure if this solves the problem. The NA cases are spread into de cases. This solution always returns the NA cases for the last variables as the last cases. It's not keeping the same row.names they have in data1. What I want to do it return exactly the same data1 (cases in the same order)

[R] change likelihood function in survreg

2011-10-07 Thread Nicolas RODE
Dear R users, I'd like to fit different longevities for males and females (µm vs µf below) with a Weibull interval-censored survival model. Unfortunately more than 50% of the individuals in the experiment died before their sex could be assigned. Hence I was wondering about fitting the propo

Re: [R] [nlme] How to calculate standard error of random effects in lme

2011-10-07 Thread Ben Bolker
Marcus Drescher tum.de> writes: > > Hi all, > > is there a way to calculate standard error of random effect > from the estimated model in lme? > Search in http://glmm.wikidot.com/faq , and post follow-up questions to the r-sig-mixed-models mailing list. Ben Bolker _

Re: [R] "r squared" and anova for linear mixed-effects model

2011-10-07 Thread Ben Bolker
florencia bonatto yahoo.com.ar> writes: > > > I have a linear > mixed-effects model (from the package > nlme) with a random effect; Is there something like > an "r squared" for the whole > model which I can state? I´d like to kown: How would I do anova for a linear > mixed-effects model? >

Re: [R] Expand dataframe according to limits defined per row

2011-10-07 Thread William Dunlap
> d <- data.frame(A=c("a","b"), B=2:3, C=c(1,3), D=c(4,5)) > lengths <- 1 + d$D - d$C > cbind(d[rep(seq_along(lengths), lengths),c("A","B")], > E=unlist(lapply(seq_along(lengths), function(i)seq(from=d$C[i], to=d$D[i] A B E 1 a 2 1 1.1 a 2 2 1.2 a 2 3 1.3 a 2 4 2 b 3 3 2.1 b 3 4 2.2 b

[R] axes3d/bbox3d - axis values not fixed

2011-10-07 Thread Ben qant
Hello, I'm using the rgl package and plotting a plot with it. I'd like to have all the axes values auto-hide, but I want to plot a series of characters instead of the values of the measurement for 2 of the axes. So in the end I will have one axis (z actually) behave per normal (auto-hide) and I'd

Re: [R] Expand dataframe according to limits defined per row

2011-10-07 Thread Uwe Ligges
On 07.10.2011 16:02, darkgaze wrote: Hi all, Would appreciate help with transforming this: A B C D a 2 1 4 b 3 3 5 into this: A B E a 2 1 a 2 2 a 2 3 a 2 4 b 3 3 b 3 4 b 3 5 (C<=E<=D) do.call(rbind, apply(dat, 1, function(x) data.frame(A=x[1], B=x[2], E=seq(x[3], x[4] Uwe Ligges

Re: [R] factors in probit regression

2011-10-07 Thread Daniel Malter
You can get an estimate for the omitted baseline category by not estimating the intercept. To do that, type "-1" on the right-hand side of the regression statement. If that was your actual question, the simple question, "How can I omit the baseline in a regression?," would have sufficed. Moreover,

Re: [R] Merge dataframes

2011-10-07 Thread Uwe Ligges
On 07.10.2011 15:34, jdanielnd wrote: Hello, I am having some problems to use the 'merge' function. I'm not sure if I got its working right. What I want to do is: 1) Suppose I have a dataframe like: height width 11.12.3 22.1

[R] probit model on time series

2011-10-07 Thread evil_iggy
I have created a few versions of a probit model that predicts (gives me a probability between 0 and 1) of a recession in the United States in the next 12 months. It uses some well known economic time series data I got from the St. Lewis Fed’s website. I got this to work with the following code: #r

Re: [R] Data frame aggregation

2011-10-07 Thread peter dalgaard
On Oct 7, 2011, at 14:53 , PHILIP GLADWIN, BLOOMBERG TRADEBOOK: wrote: > Hello, > Could anybody help me with this question? > > Example data frame > NAME TICKER SHARES PERFORMANCE > John ABC1000.05 > John ABC1000 1.5 > Alice

[R] Strange behaviour with the Homals Package

2011-10-07 Thread marco stamazza
Dear R users and experts, I am using Homals to perform categorical PCA on some survey data. The documentation is a bit obscure, however, I followed the examples. X is a matrix with ordinal 1-5 Likert scale entries on 24 questions from about 2500 respondents. So I run X.nlpc = homals(X, rank =

Re: [R] Coefficients for lagged plm model variables not calculated

2011-10-07 Thread humball
Hi Daniel, Thanks for your thoughts on this and taking the time to feed back. There may indeed be some quai-collinearity as you describe in some of the variables, although they are strongly seasonal (they represent commodity prices in rural agricultural systems), but from time period to time perio

Re: [R] ANOVA/ANCOVA Repeated Measure Mixed Model

2011-10-07 Thread Nick GH
Hi Daniel, Thanks for your response, I don't completely follow. I also should have split this into two questions. Regarding my first question: Daniel Malter wrote: > > You are modeling Condition * Stimulus * Group as fully interacted fixed > effects... A simple random effect for the individua

[R] Find a particular point on a curve

2011-10-07 Thread Joanie
Hi, my question is really precise. I'm interested in drops of stomacal temperature (of seal pups) following milk ingestion. Temperature starts at an average of 37.8oC (sd=0.2) and drops rapidly to around 36.0oC and then stabilizes slowly to a temperature silimar to the previous one. It looks a bit

[R] Expand dataframe according to limits defined per row

2011-10-07 Thread darkgaze
Hi all, Would appreciate help with transforming this: A B C D a 2 1 4 b 3 3 5 into this: A B E a 2 1 a 2 2 a 2 3 a 2 4 b 3 3 b 3 4 b 3 5 (C<=E<=D) Best, Don -- View this message in context: http://r.789695.n4.nabble.com/Expand-dataframe-according-to-limits-defined-per-row-tp3882319p3882319.

[R] Merge dataframes

2011-10-07 Thread jdanielnd
Hello, I am having some problems to use the 'merge' function. I'm not sure if I got its working right. What I want to do is: 1) Suppose I have a dataframe like: height width 11.12.3 22.12.5 31.81.9 4

[R] Linear programming problem, RGPLK - "no feasible solution"

2011-10-07 Thread Liu Evans, Gareth
Dear All, RGLPK says that there is no feasible solution but I think there should be. In a more general setup with more variables, where we know the feasible solution analytically, it also says there is no feasible solution. I have tried different values. except the 0s and 1s must stay as they

Re: [R] gefp() boundaries?

2011-10-07 Thread bonda
Well, I am still confused... shouldn't the "made-by-hands"-process (correctly constructed, of course) and the gefp()-process be similar? For the case of efp()-process it has been worked, at least... Besides, I'd like to know: 1) if I have the gefp()-process (scaled to unit interval [0;1]), can I ge

Re: [R] Data frame aggregation

2011-10-07 Thread jim holtman
Here is one way to do it using data.table package: > x <- read.table(textConnection("NAME TICKER SHARES PERFORMANCE + John ABC1000.05 + John ABC1000 1.5 + Alice EFG20 0.3 + Paul HIJ50 1.0 + Paul JKL

[R] How to calculate determinant and inverse matrix of a specific structure

2011-10-07 Thread abbyry
Hi All, I have a specific structure matrix, which is a AR(1) matrix plus a diagonal matrix, i.e., Mat = sigma^2 * M(rho) + tau^2 * I, where M(rho)_ij = rho^abs(i-j). How can I calculate det(Mat) and solve(Mat) efficiently? I'm using the det() and solve() functions now, but since I'm calculating

[R] "r squared" and anova for linear mixed-effects model

2011-10-07 Thread florencia bonatto
I have a linear mixed-effects model (from the package nlme) with a random effect; Is there something like an "r squared" for the whole model which I can state? I´d like to kown: How would I do anova for a linear mixed-effects model? Lic. Florencia BonattoUniversidad Nacional de Rio Cuarto,

Re: [R] Wide to long form conversion

2011-10-07 Thread David Winsemius
On Oct 7, 2011, at 1:30 PM, David Winsemius wrote: On Oct 7, 2011, at 7:40 AM, Gang Chen wrote: Jim, I really appreciate your help! I like the power of rep_n_stack, but how can I use rep_n_stack to get the following result? Subj Group value Ref Var Time 1S1 s 4 Me F1 2

Re: [R] Wide to long form conversion

2011-10-07 Thread David Winsemius
On Oct 7, 2011, at 7:40 AM, Gang Chen wrote: Jim, I really appreciate your help! I like the power of rep_n_stack, but how can I use rep_n_stack to get the following result? Subj Group value Ref Var Time 1S1 s 4 Me F1 2S1 s 3 Me F2 3S1 s 5 Me

[R] Creating One Single Object Linking Multiple Datapoints

2011-10-07 Thread Ben Ganzfried
Thanks, Martin. Based on my previous post, I thought of a more general formulation of my question that I think would be helpful to ask here. What's the best way to build an R object that links multiple datapoints about different people? I mean, I happen to have datasets that have individual gene

Re: [R] Error in Penalized Command

2011-10-07 Thread Uwe Ligges
On 07.10.2011 05:50, Cheryl Johnson wrote: How do I fix this error in the penalized command? L<-penalized(y,x,lambda1=10) Assuming this is the function penalized of the penalized package (unstated): The lengths of your x and y differ. Uwe Ligges Error in .checkinput(match.call(), pare

Re: [R] factors in probit regression

2011-10-07 Thread Pablo García Díaz
Dear Daniel, I was thinking on what's wrong with you, and what it is supposed you're trying to critisize without knowing my work or any other detail. For your knowledge, the model I've sent was just an example; I've fitted 17 different models (no interactions, only one factor, etc) and of course t

Re: [R] function - access column

2011-10-07 Thread David Winsemius
On Oct 7, 2011, at 11:25 AM, Ana wrote: Thanks! It helps. I completely forgot about the colnames function I added a "which(colnames(m)==n)" to my own function and now I can access with no problem the column by the number instead of the name. 'which' returns a logical vector. You could have

Re: [R] Suppress only the x-axis tick mark labels XXXX

2011-10-07 Thread David Winsemius
On Oct 7, 2011, at 11:15 AM, Dan Abner wrote: Hi everyone, How does one suppress only the x-axis tick mark labels (not the tick marks themselves, I want those and the entire y-axis labels and marks) in the plot() fn? Perhaps: xaxt="n" (Followed by an axis call to put the x-ticks in.

Re: [R] Handling Time in R

2011-10-07 Thread jim holtman
?ISOdatetime > x <- ISOdatetime(2011,10,6,16,23,30.539) > str(x) POSIXct[1:1], format: "2011-10-06 16:23:30" > y <- ISOdatetime(2011,10,6,16,23,30.939) > difftime(y,x) Time difference of 0.399 secs > On Fri, Oct 7, 2011 at 11:04 AM, Alaios wrote: > Dear all, > I would like to ask your hel

[R] Pb building sets of S4 / RefClass objects with package "sets"

2011-10-07 Thread Johnny Paulo
Hi, does anyone know if it is possible to construct sets of S4 objects? It seems the constructor set does not like it: Error in as.vector(x, "character") : cannot coerce type 'environment' to vector of type 'character' Regards Johnny [[alternative HTML version deleted]]

Re: [R] function - access column

2011-10-07 Thread Ana
Thanks! It helps. I completely forgot about the colnames function I added a "which(colnames(m)==n)" to my own function and now I can access with no problem the column by the number instead of the name. On Fri, Oct 7, 2011 at 5:09 PM, R. Michael Weylandt wrote: > Perhaps something like this:

[R] Suppress only the x-axis tick mark labels XXXX

2011-10-07 Thread Dan Abner
Hi everyone, How does one suppress only the x-axis tick mark labels (not the tick marks themselves, I want those and the entire y-axis labels and marks) in the plot() fn? thanks! Dan [[alternative HTML version deleted]] __ R-help@r-project.or

Re: [R] function - access column

2011-10-07 Thread R. Michael Weylandt
Perhaps something like this: Test <- function(m){ m <- if(is.character(m)) get(m) else m stopifnot(length(colnames(m))>0) n = colnames(m) # Process n however 2* m[, n] } That make sense? Hope it helps, Michael On Oct 7, 2011, at 11:03 AM, Ana wrote: > How can I call

[R] Handling Time in R

2011-10-07 Thread Alaios
Dear all, I would like to ask your help regarding handling time stamps in R. I think first I need a reference to read about their logic and how I should handle them. For example, this is a struct I have str(MyStruct$TimeStamps)  num [1:100, 1:6] 2011 2011 2011 2011 2011 ... MyStruct$TimeStamp

Re: [R] Tinn-R

2011-10-07 Thread Leandro Marino
*Paul, I didn't understood your problem with tinn-r. I don't work at a lab, so i have no idea how it can be your specific problem. I think it has a problem with R + Win 7 that is about the changes in the permissions at Program Files folder. What am i doing to cheat this problem. 1) Install R and

[R] function - access column

2011-10-07 Thread Ana
How can I call matrix$col, inside a function? The matrix name is one of the variables of the function, while the column name I get by assuming that it should have a certain characters. something like this function(matrix){ colname=as.name(grep("[A-T a-t]ting",colnames(matrix),value=TRUE)) output=

Re: [R] Creating One Single Object with Phenotype and Expression Data

2011-10-07 Thread Martin Morgan
Hey Ben -- this is a bioconductor question so please ask on the Bioconductor mailing list. Good news, you don't have to subscribe to post http://bioconductor.org/help/mailing-list/ Martin On 10/07/2011 07:27 AM, Ben Ganzfried wrote: Hey, I have code that can check the quality of a data set w

Re: [R] RStudio and findFn{sos}

2011-10-07 Thread Spencer Graves
On 10/7/2011 7:05 AM, Ben Bolker wrote: Heverkuhn Heverkuhn gmail.com> writes: [snip] when I launch findFn from RStudio ( but not from R console) the table of results does not pop in the browser and I got a warning. findFn("test") found 9914 matches; retrieving 20 pages, 400 matches. 2 3 4

[R] Creating One Single Object with Phenotype and Expression Data

2011-10-07 Thread Ben Ganzfried
Hey, I have code that can check the quality of a data set we're working with (expression data), and I'm having some trouble writing code that would make the expression data we have tie to other data we want to link it to (called phenotype data). Does anyone have any advice on how I could make a s

Re: [R] plot autocovariance.

2011-10-07 Thread Jean-Christophe BOUËTTÉ
Hi, let's say x <- c(1,.5,.3,.1) I assume you tried: plot(x) You can try: plot(seq(x)-1,x) Also take a look at ?acf JC 2011/10/7 Chuse chuse : > dDear all, > > I have calculated a vector of autocovariances. When I plot it, the > variance appears at x-tick 1. How can i change the x-axis so that

Re: [R] generate sequences for every element of a vector

2011-10-07 Thread R. Michael Weylandt
Untested, wouldn't outer(x, 0:n,"+") work as well and be a little faster? M On Oct 7, 2011, at 9:58 AM, Dimitris Rizopoulos wrote: > One option is: > > x <- c(3, 8, 14, 24, 34, 40) > c(sapply(x, seq, length = 3)) > > > I hope it helps. > > Best, > Dimitris > > > On 10/7/2011 3:40 PM, Mar

[R] plot autocovariance.

2011-10-07 Thread Chuse chuse
dDear all, I have calculated a vector of autocovariances. When I plot it, the variance appears at x-tick 1. How can i change the x-axis so that the vector plot starts at zero? Thank you beforehand. Chuse. __ R-help@r-project.org mailing list https://sta

Re: [R] RStudio and findFn{sos}

2011-10-07 Thread Ben Bolker
Heverkuhn Heverkuhn gmail.com> writes: > [snip] > when I launch findFn from RStudio ( but not from R > console) > the table of results does not pop in the browser and I got a warning. > > findFn("test") > found 9914 matches; retrieving 20 pages, 400 matches. > 2 3 4 5 6 7 8 9 10 11 12 13 14 15

[R] RStudio and findFn{sos}

2011-10-07 Thread Heverkuhn Heverkuhn
Hello everyone, I have this problem, when I launch findFn from RStudio ( but not from R console) the table of results does not pop in the browser and I got a warning. findFn("test") found 9914 matches; retrieving 20 pages, 400 matches. 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 Warning mes

Re: [R] generate sequences for every element of a vector

2011-10-07 Thread Dimitris Rizopoulos
One option is: x <- c(3, 8, 14, 24, 34, 40) c(sapply(x, seq, length = 3)) I hope it helps. Best, Dimitris On 10/7/2011 3:40 PM, Martin Batholdy wrote: Dear R-List, I have the following problem: I have a vector that looks like this: x<- c(3, 8, 14, 24, 34, 40) And I would like to make

Re: [R] generate sequences for every element of a vector

2011-10-07 Thread Jean-Christophe BOUËTTÉ
Or a more general form: n <- 3 as.vector(matrix(rep(x,each=n),nrow=n)+0:(n-1)) 2011/10/7 Jean-Christophe BOUËTTÉ : > Hi, > this should work: > as.vector(rbind(x,x+1,x+2)) > > 2011/10/7 Martin Batholdy : >> Dear R-List, >> >> >> I have the following problem: >> >> I have a vector that looks like th

Re: [R] generate sequences for every element of a vector

2011-10-07 Thread Martin Batholdy
great, thank you! On 07.10.2011, at 15:54, Jean-Christophe BOUËTTÉ wrote: > Hi, > this should work: > as.vector(rbind(x,x+1,x+2)) > > 2011/10/7 Martin Batholdy : >> Dear R-List, >> >> >> I have the following problem: >> >> I have a vector that looks like this: >> >> x <- c(3, 8, 14, 24, 34,

Re: [R] generate sequences for every element of a vector

2011-10-07 Thread Jean-Christophe BOUËTTÉ
Hi, this should work: as.vector(rbind(x,x+1,x+2)) 2011/10/7 Martin Batholdy : > Dear R-List, > > > I have the following problem: > > I have a vector that looks like this: > > x <- c(3, 8, 14, 24, 34, 40) > > > And I would like to make a sequence out of every element, starting at the > value of th

Re: [R] R equivalent of proc varclus

2011-10-07 Thread Ajay Ohri
Dear List got the answer- thanks- http://127.0.0.1:11568/library/Hmisc/html/varclus.html varclus {Hmisc}R Documentation Variable Clustering Description Does a hierarchical cluster analysis on variables, using the Hoeffding D statistic, squared Pearson or Spearman correlations, or proportion of

[R] generate sequences for every element of a vector

2011-10-07 Thread Martin Batholdy
Dear R-List, I have the following problem: I have a vector that looks like this: x <- c(3, 8, 14, 24, 34, 40) And I would like to make a sequence out of every element, starting at the value of this element. So that I get a vector just like this: x <- c(3, 4, 5, 8, 9, 10, 14, 15, 1

[R] [nlme] How to calculate standard error of random effects in lme

2011-10-07 Thread Marcus Drescher
Hi all, is there a way to calculate standard error of random effect from the estimated model in lme? Best Marcus [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do

Re: [R] accumulate vector data

2011-10-07 Thread R. Michael Weylandt
cumsum() On Oct 7, 2011, at 6:55 AM, "Karl Weinmayer" wrote: > Hi, > > > > What is the best way to accumulate the entries in a vector. For example, > > > > a <- c(1,2,3,4,5) > > > > And I want to have > > > > b <- c(1,3,6,10,15) > > > > > > Best, > > Karl > > > > > > >

[R] Kendall's Partial correlation

2011-10-07 Thread Nanthinee Jeevanandam
Hi, I am using library (ppcor) to run Kendall's partial correlation. I use pcor.test(x,y,z,method=c("Kendall")) but I get " system is computationally singular: reciprocal condition number = 0". I have zero values in y and z. How can I overcome this? Isn't non-parametric zero friendly? Nanthine

[R] Data frame aggregation

2011-10-07 Thread PHILIP GLADWIN, BLOOMBERG TRADEBOOK:
Hello, Could anybody help me with this question? Example data frame NAME TICKER SHARES PERFORMANCE John ABC1000.05 John ABC1000 1.5 Alice EFG20 0.3 Paul HIJ50 1.0 Paul JKL

[R] Repeated Measures Regression

2011-10-07 Thread Andreas Pedroni
Dear list, I'm trying to calculate a regression on a dataset with repeated measures. I tried to look for an example on the web and in Pinheiro and Bates "Mixed-Effects Models in .. " book. However, I' m not sure wether the regression model I'm using is the "right" one. I'm very thankful for an

[R] Strange behaviour with the Homals Package

2011-10-07 Thread marco stamazza
Dear R users and experts, I am using Homals to perform categorical PCA on some survey data. The documentation is a bit obscure, however, I followed the examples. X is a matrix with ordinal 1-5 Likert scale entries on 24 questions from about 2500 respondents. So I run X.nlpc = homals(X, rank =

Re: [R] About stepwise regression problem

2011-10-07 Thread Gavin Simpson
On Thu, 2011-10-06 at 20:12 -0700, pigpigmeow wrote: > chris, > I'm not using lmer, i just use gam mixed with smoothing function and linear > function > I have the following question, > 1.if I reject the variable term which has greater the p-value no matter the > variable term is smoothing term or

Re: [R] About stepwise regression problem

2011-10-07 Thread Frank Harrell
Removing variables because of high P-values is not a valid procedure. Use of AIC or BIC is just a restatement of P-values. AIC can be quite useful if you have posited a very small number of fully pre-specified models (e.g., 2 or 3) and want to choose between them. Stepwise variable selection wit

[R] R equivalent of proc varclus

2011-10-07 Thread Ajay Ohri
Dear List What is the R package equivalent of Proc Varclus or Information Value. ANy assistance in determining R equivalents of f Oblique Component Analysis (PROC VARCLUS), Information Value (IV) and Weight Of Evidence (WOE) analysis, and business intelligence http://www.nesug.org/proceedings/nes

Re: [R] Mean(s) from values in different row?

2011-10-07 Thread David Winsemius
On Oct 7, 2011, at 2:45 AM, Petr PIKAL wrote: Hi Hello: Is there a way to get a mean from values stored in different rows? The data looks like this: YEAR-1, JAN, FEB, ..., DEC YEAR-2, JAN, FEB, ..., DEC YEAR-3, JAN, FEB, ..., DEC The details of datA entry may need to be fleshed out. M

Re: [R] factors in probit regression

2011-10-07 Thread David Winsemius
On Oct 7, 2011, at 1:32 AM, Daniel Malter wrote: Note that the whole model screams at you that it is wrongly modeled. You are running a fully interacted model with factor variables. Thus, you have 19 regressors plus the baseline for 150 observations. Note that all your coefficients are insi

Re: [R] accumulate vector data

2011-10-07 Thread Duncan Murdoch
On 11-10-07 6:55 AM, Karl Weinmayer wrote: Hi, What is the best way to accumulate the entries in a vector. For example, a<- c(1,2,3,4,5) And I want to have b<- c(1,3,6,10,15) cumsum(a) Duncan Murdoch __ R-help@r-project.org mailing list

Re: [R] modify "..." (optional args)

2011-10-07 Thread Duncan Murdoch
On 11-10-07 4:39 AM, Pascal A. Niklaus wrote: Hi all, Is there a way to modify the optional arguments (...) passed to a function, so that these can be passed in modified form to a subsequent function call? I checked "Programming with Data" but could not find a solution there. Not as such, but

Re: [R] Running *slow*

2011-10-07 Thread thomas.chesney
Making a bit more sense now: "If you are translating code into R that has a double for loop, think." The R Inferno, Page 18. -- View this message in context: http://r.789695.n4.nabble.com/Running-slow-tp3878093p3881951.html Sent from the R help mailing list archive at Nabble.com. ___

Re: [R] Asking an old housekeeping question... (answered)

2011-10-07 Thread Brian Lunergan
S Ellison wrote: > ??dependencies shows up (on my system) > > tools::package.dependencies > tools::dependsOnPkgs > > The first looks for dependencies; the second for reverse dependencies. Just a quick thanks for the assist in understanding this question. Worked out well. So... Having also added

[R] Odp: accumulate vector data

2011-10-07 Thread Petr PIKAL
Hi ?cumsum Regards Petr > > Hi, > > > > What is the best way to accumulate the entries in a vector. For example, > > > > a <- c(1,2,3,4,5) > > > > And I want to have > > > > b <- c(1,3,6,10,15) > > > > > > Best, > > Karl > > > > > > >[[alternative HTML version dele

Re: [R] Wide to long form conversion

2011-10-07 Thread Gang Chen
Jim, I really appreciate your help! I like the power of rep_n_stack, but how can I use rep_n_stack to get the following result? Subj Group value Ref Var Time 1S1 s 4 Me F1 2S1 s 3 Me F2 3S1 s 5 Me J1 4S1 s 6 Me J2 5

[R] Regression Package - for large dataset with lots of variables

2011-10-07 Thread Ajay Ohri
Dear List, I am trying to create a model for a relatively big dataset of a few million obs. The number of variables is huge and runs into hundreds. What are my choices for creating regression model - and what are the drawbacks of using stepwise regression. Is the BigLM package helpful, or should

[R] modify "..." (optional args)

2011-10-07 Thread Pascal A. Niklaus
Hi all, Is there a way to modify the optional arguments (...) passed to a function, so that these can be passed in modified form to a subsequent function call? I checked "Programming with Data" but could not find a solution there. What I'd like is something along these lines: test <- functi

[R] accumulate vector data

2011-10-07 Thread Karl Weinmayer
Hi, What is the best way to accumulate the entries in a vector. For example, a <- c(1,2,3,4,5) And I want to have b <- c(1,3,6,10,15) Best, Karl [[alternative HTML version deleted]] __ R-help@r-project.org mailing

Re: [R] Wide to long form conversion

2011-10-07 Thread Gang Chen
Dennis, Yes, I was wrong! The variables should be: 1) Subj: factor 2) Group: between-subjects factor (2 levels: s / w) 3) Reference: within-subject factor (2 levels: Me / She) 4) F/J: within-subject factor (2 levels: F / J) 5) Time: within-subject factor (2 levels: 1 / 2) 6) Value So your mData3

Re: [R] barplots

2011-10-07 Thread Jim Lemon
On 10/07/2011 08:16 AM, Daniel Winkler wrote: Hello, I have somewhat of a weird data set and am attempting to create a barplot with it. I have 8 columns with different variables and their percentages. I have 1 column with representations of 4 different treatments the variables undergo. I also h

Re: [R] Wide to long form conversion

2011-10-07 Thread Jim Lemon
On 10/07/2011 07:28 AM, Gang Chen wrote: I have some data 'myData' in wide form (attached at the end), and would like to convert it to long form. I wish to have five variables in the result: 1) Subj: factor 2) Group: between-subjects factor (2 levels: s / w) 3) Reference: within-subject factor (

[R] iplots

2011-10-07 Thread fernando.cabrera
Hi guys, I am trying to plot a scatterplot with lines instead of with points using function iplot in library iplots. The best I can come up with is x =(1:100) y = rnorm(100) iplot(x,y,ptDiam=0) ilines(x,y) Do you guys know of any paramter to set the "type" in iplot or iplot.opt? Thanks, Fe

Re: [R] handling constant factors in prediction using svm

2011-10-07 Thread Divyam
Ok. I should have made the question clearer. By asking is there anyway to solve this problem, what I meant was, how to give exceptions to such scenarios. My mistake and apologies for that. I can understand why prediction cannot be done when a trained variable is missing in the test set :). thanks f

Re: [R] Running *slow*

2011-10-07 Thread thomas.chesney
Gerrit, Looks like it does and in less than--an incredible--one minute! Thank you! -- View this message in context: http://r.789695.n4.nabble.com/Running-slow-tp3878093p3881588.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r

[R] Time-dependent covariates in coxph model

2011-10-07 Thread Michael Haenlein
Dear all, I have a question about time-dependent covariates in a coxph model. Specifically I am wondering whether it is possible to give more recent events a higher weight when constructing time-dependent covariates. Assume I have a sample of cancer patients and I would like to predict whether th

Re: [R] Running *slow*

2011-10-07 Thread Gerrit Eichner
Hi, Thomas, if I'm not completely mistaken Dat2 <- match( t( Dat), ltable) should do what you want. Hth -- Gerrit On Fri, 7 Oct 2011, thomas.chesney wrote: Thank you Michael and Patrick for your responses. Michael - your code ran in under 5 minutes, which I find stunning, and Patrick I hav

Re: [R] Running *slow*

2011-10-07 Thread thomas.chesney
Thank you Michael and Patrick for your responses. Michael - your code ran in under 5 minutes, which I find stunning, and Patrick I have sent the Inferno doc to the copier for printing and reading this weekend. I now have 8 million values in my lookup table and want to replace each value in Dat wit

Re: [R] reporting multiple objects out of a function

2011-10-07 Thread Prof Brian Ripley
I am baffled as to why so many people think this is the address of the maintainers of the 'fortunes' package. maintainer('fortunes') [1] "Achim Zeileis " says otherwise (if you have it installed). Things do get very easily buried in the volume of mail of R-help: it is not a good way to com

  1   2   >