Hello R User,
I was trying to display r.squared and p value in table from regression, but I 
could not display these parameters in the table (matrix)

for example 
individual <- c(1,1,6,8,8,9,9,9,12,12)
day <- c(4,17,12,12,17,3,9,22,13,20)
condition <- c(0.72, 0.72, 0.67, 0.73, 0.76, 0.65, 0.68, 0.78, 0.73, 0.71)      
 
test <- data.frame(individual, day, condition)
ind.id <- unique(test$individual)
ind.list <- lapply(1:length(ind.id), function(i){ subset(test, 
test$individual==ind.id[i])})
lms <- lapply(ind.list, lm, formula=condition~day)
ldply(lms, function(x) x$coefficients)
here I can display coefficients, here I need to write code for r2.squared

I tried with following script

summary(ldply(lms, function(x) )$r.squared, $p value)
but it did not work.

can any one help me?

thanks 
Kristi


                                          
        [[alternative HTML version deleted]]

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to