Re: [R] How to catch data from the different dataframes and lm problem?

From: Hsin-Ya Lee <leeznar_at_yahoo.com.tw>
Date: Sun, 30 Dec 2007 21:22:53 -0800 (PST)

Dear Richie:

  1. I have a mistake in the code that “A.split[[1]][["time"]][i]” should replace with “A.split[[j]][["time"]][i]”. The “test” value is “auc” which is a cumulative rate of change of concentration with respect to time.

for (j in 1:length(A.split)){
test <- 0
for(i in 2:length(A.split[[j]][["time"]])){

    test[i] <- (A.split[[j]][["time"]][i] - A.split[[j]][["time"]][i-1]) * (A.split[[j]][["concentration"]][i] - A.split[[j]][["concentration"]][i-1])* 0.5

    test[i]<-test[i]+test[i-1]
 }
output<-data.frame(A.split[[j]][["subject"]],A.split[[j]][["formulation"]],A.split[[j]][["time"]],A.split[[j]][["concentration"]],test) colnames(output)<-list("subject","formulation","time","concentration","test") show(output)
}

subject formulation time concentration(X) test(Y)

1       1           1    1           0.1  0.00
2       1           1    2          10.0  4.95
3       1           1    3          20.0  9.95
  subject formulation time concentration(X) test(Y)
1       1           2    1            20  0.0
2       1           2    2            25  2.5
3       1           2    3            60  20.0
  subject formulation time concentration(X) test(Y)
1       2           1    1           0.3  0.00
2       2           1    2           2.5  1.10
3       2           1    3           6.0  2.85
  subject formulation time concentration(X) test(Y)
1       2           2    1            35  0.0
2       2           2    2            40  2.5
3       2           2    3            45  5.0

2) Then, I want to pool all "concentration" (X) and pool all "test" (Y) to perform a
regression. For example, I used the “regression” function of Microsoft Excel 2003 and intercept is -0.01894 and X is 0.185758. I think that if I can catch “test” (Y) values and “concentration” (X) values into a dataframe, then I can use “lm” to fit linear models. So, how to catch all “test” values from different dataframes? Or what should I do?

Best regards,

Hsin-Ya Lee

-- 
View this message in context: http://www.nabble.com/How-to-catch-data-from-the-different-dataframes-and-lm-problem--tp14521967p14554462.html
Sent from the R help mailing list archive at Nabble.com.

______________________________________________
R-help_at_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.
Received on Mon 31 Dec 2007 - 05:26:02 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Mon 31 Dec 2007 - 08:30:21 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.