Graph repeated measures - need grand mean

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Graph repeated measures - need grand mean

Mary Lynn-2
I have a data set with 25 different sites from which subjects are
obtained.  Data collection occurred at 3 time periods and I want to create
a plot of the means from each time period for each site (separately) but I
need to have the grand mean line on there as well.  How do I do this?  Can
I generate something like this from within the GLM/repreated measures
commands?

Thanks for your help.

Mary
Reply | Threaded
Open this post in threaded view
|

Re: Graph repeated measures - need grand mean

Marta García-Granero
Hi Mary

ML> I have a data set with 25 different sites from which subjects are
ML> obtained.  Data collection occurred at 3 time periods and I want to create
ML> a plot of the means from each time period for each site (separately) but I
ML> need to have the grand mean line on there as well.  How do I do this?  Can
ML> I generate something like this from within the GLM/repeated measures
ML> commands?

I think the answer is no. I did something related (not exactly the
same situation but I had to create a graph with some horizontal lines
that had been computed previously) time ago. The process was a bit
complicated, it involved a MACRO with the computeation of the
reference lines, adding them to the active file, and writing a
syntax file to disk (with an IGRAPH command) that was later included.

This is just one small part of the MACRO I used to write one graph with
3 reference lines and the Y range:

DEFINE blah, blah, blah....

The reference lines and Y range was computed using MATRIX (code
skipped) and saved to disk (with names col1 to col5). In your case,
you could use AGGREGATE to compute the mean you need and add it to the
active file.
.
.
.
* Add data to file *.
MATCH FILES /FILE=*
 /FILE='c:\temp\LOA&Range.sav'.
* The 5 values are read and turnt into text *.
STRING #var1 TO #var5 (A8).
DO REPEAT A=#var1 TO #var5 /B=col1 TO col5.
- COMPUTE A = STRING(B,F8.3).
END REPEAT.
DO IF $casenum EQ 1.
- !LET !reflin1=!UNQUOTE(#var1).
- !LET !reflin2=!UNQUOTE(#var2).
- !LET !reflin3=!UNQUOTE(#var3).
- !LET !ymin=   !UNQUOTE(#var4).
- !LET !ymax=   !UNQUOTE(#var5).
* Write IGraph COMMAND (with the 5 values) to syntax file & run it *.
WRITE OUTFILE 'c:\temp\LOAGraph.sps'
/ "IGRAPH"
/" /VIEWNAME='Bland-Altman LOA plot'"
/"  /X1 = VAR(mean) TYPE = SCALE"
/"  /Y = VAR(diff) TYPE = SCALE (MIN=" !ymin" MAX="!ymax")"
/"  /COORDINATE = VERTICAL"
/"  /X1LENGTH=3.0"
/"  /YLENGTH=3.0"
/"  /REFLINE diff "!reflin1
/"  /REFLINE diff "!reflin2
/"  /REFLINE diff "!reflin3
/"  /SCATTER COINCIDENT = NONE.".
END IF.
CACHE.
EXE.
INCLUDE 'c:\temp\LOAGraph.sps'.
.
.
.

As you can see, the process was a bit tricky. If you are not going to
need the code more than once, I don't think it is worth the effort.
Add the reference line to the graphs one by one.


--
Regards,
Dr. Marta García-Granero,PhD           mailto:[hidden email]
Statistician