Re: [R] glm analysis repeated for 900 variables

2009-09-23 Thread Christian Schulz
> > On 23/09/2009, at 11:26 PM, Christian Schulz wrote: > > > Hi, > > > > > > nvars <- 902 > > data <- as.data.frame(matrix(runif(100*nvars),ncol=nvars)) > > colnames(data)[901] <- c('phenotype') > > colnames(data)[902] <- c('outcome') > > > > Just ***WHAT*** do you think the ``c( )''

Re: [R] glm analysis repeated for 900 variables

2009-09-23 Thread Rolf Turner
On 23/09/2009, at 11:26 PM, Christian Schulz wrote: Hi, nvars <- 902 data <- as.data.frame(matrix(runif(100*nvars),ncol=nvars)) colnames(data)[901] <- c('phenotype') colnames(data)[902] <- c('outcome') Just ***WHAT*** do you think the ``c( )'' is doing for you in the construction

Re: [R] glm analysis repeated for 900 variables

2009-09-23 Thread Christian Schulz
Hi, nvars <- 902 data <- as.data.frame(matrix(runif(100*nvars),ncol=nvars)) colnames(data)[901] <- c('phenotype') colnames(data)[902] <- c('outcome') ### catch all aic values ### res <- matrix(nrow=900,ncol=2) for (i in 1:(length(data)-2)) { res[i,1] <- names(data)[i] res[i,2] <- glm(outco

[R] glm analysis repeated for 900 variables

2009-09-22 Thread Terwisscha van Scheltinga, A.
Dear R users, Could you help my with the following problem? I want to repeat a glm analysis with 2 independent variables for all 900 variables (snps) in my data set. So, I want to check whether snp1 has a different effect on my outcome variable in patients and controls(phenotype). And repeat that