Hello everyone,
 
for some exploratory analysis I would like to compare the distribution of an
observable WERT pairwise between several samples identified by STICHPROBE
(which differ in size).
 
> str(stichproben_o1o4_20080327ff[c("STICHPROBE", "WERT")])
'data.frame':   6087 obs. of  2 variables:
 $ STICHPROBE: num  9 9 2 2 7 3 2 3 8 6 ...
 $ WERT      : num  165 184 110 131 87 111 210 88 159 198 ...

A good way to compare two distributions is a Q-Q or Tukey mean-difference
(tmd) plot. I would like to arrange these qq or tmd plots in a matrix as the
pairs() function does.
 
Can pairs() be made to immediately produce tmd plots instead of plain
scatter plots, or will I have to do the tmd processing in a separate step
and only pass the such preprocessed xy data to pairs()?
 
Another problem is the representation of the data with respect to pairs().
My data.frame identifies the sample of each measurement in column
STICHPROBE. It does not have one column for each sample (note again that the
samples differ in size). From what I understand about pairs() it requires a
separate column for each variable. The reshape() function should be able to
change the representation but the best I can achieve is a "wide" dataframe
with multiple columns (as desired) but no rows:
 
> reshape(stichproben_o1o4_20080327ff[c("STICHPROBE", "WERT")],
timevar="STICHPROBE", direction="wide")
 [1] WERT.9 WERT.2 WERT.7 WERT.3 WERT.8 WERT.6 WERT.1 WERT.4 WERT.0 WERT.5
<0 rows> (or 0-length row.names)
 
Best regards

Stefan

 

        [[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