[R] Covariance/Correlation matrix for repeated measures data frame

From: Afshartous, David <afshart_at_exchange.sba.miami.edu>
Date: Wed 06 Sep 2006 - 15:59:04 GMT


I have a repeated measures data frame and was wondering if the covariance matrix can be
calculated via some created indexing or built-in R function.  

Specifically, say there are 3 variables, where potassium concentration is measured 6 times on each patient.
Patient number (discrete)
Time (1 to 6, discrete)
Potassium (continuous variable)  

I want the covariance/correlation matrix for the cov/corr between Potassium at time i and time j.  

Is this possible in the current dataframe format? Or do I have to define new varialbes, say Time i and Time j, and then compute the cov/corr between Time i and Time j for all combinations?  


David Afshartous, PhD
University of Miami
School of Business
Rm KE-408
Coral Gables, FL 33124  

        [[alternative HTML version deleted]]

R-help@stat.math.ethz.ch 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 Thu Sep 07 02:07:27 2006

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.1.8, at Thu 07 Sep 2006 - 07:51:18 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.