I have been trying to use the Hmisc package to produce output similar to below.
Group
Step Method G1 G2 G3 .......
s1 m1 N 45 26 17
Min 2 2 3
Max 7 6 4
Mean 3.5 4.5 2.5
Sdev 2.6 3.6 1
m2 N
Min
Max
Mean
Sdev
s2 m1 N
Min
Max
Mean
Sdev
m2 N
Min
Max
Mean
Sdev
My raw data looks like below.
Site Step Method Group Outcome
a1 s1 m1 g1 3.6
a1 s1 m4 g1 2.3
a2 s2 m1 g2 14
a3 s1 m3 g1 7
a3 s3 m6 g1 1
a4 s1 m1 g3 6.2
I am trying to compute the n, min, mean, sdev, and max for all the site outcomes in each group,by step and method. I am using the sites as my unique identifiers. Not every site has every step, and not every step has every method, so there are missing values. I have been playing with the Hmisc package, and have been able to compute the n, mean, min, and max using fun=summary
,
but I have only been able to do it for each method individually, and it is displayed in a not so pretty matrix. I know that the package uses latex (I am total novice with this), and I have used the option in summary(....,file="data.tex")
I think it is to save a .dvi file, which I right click on and tell it to covert to pdf, but the pdf is all broken looking with data in the wrong place. I really don't know what I am doing wrong, so any feedback/input is greatly appreciated.
Cheers.