Hi all,
I’m following the example from this website: Section 5. Perform tests with separate slopes for all diet groups.
Here is my syntax.
glm DV by group group12 with Covariate
/design group Covariate group12* Covariate
/print parameter
/LMATRIX "group 1 vs 3 at 20 Covariate” group 1 0 -1 group12*Covariate 20 -20
/LMATRIX "group 1 vs 3 at 26 Covariate” group 1 0 -1 group12*Covariate 26 -26
/LMATRIX "group 1 vs 3 at 32 Covariate” group 1 0 -1 group12*Covariate 32 -32
/LMATRIX "DV for group 1 at 20 Covariate" intercept 1 group 1 0 0 Covariate 20 group12*Covariate 20 0
/LMATRIX "DV for group 1 at 26 Covariate" intercept 1 group 1 0 0 Covariate 26 group12*Covariate 26 0
/LMATRIX "DV for group 1 at 32 Covariate" intercept 1 group 1 0 0 Covariate 32 group12*Covariate 32 0
/LMATRIX "DV for group 3 at 20 Covariate" intercept 1 group 0 0 1 Covariate 20 group12*Covariate 0 20
/LMATRIX "DV for group 3 at 26 Covariate" intercept 1 group 0 0 1 Covariate 26 group12*Covariate 0 26
/LMATRIX "DV for group 3 at 32 Covariate" intercept 1 group 0 0 1 Covariate 32 group12*Covariate 0 32.
It runs just fine.
The results of the first 3 /LMATRIX commands make sense given the data. They are the differences between the groups at each of these values of the covariate. They seem a bit extreme considering the actual means but
they could make sense.
What has me puzzled is that the next 6 /LMATRIX commands are supposed to give the adjusted means for the groups at each of the levels of the covariate but they don’t quite seem correct, especially for group 3. They
are coming out negative which isn’t possible for the data.
Since I’m using a comparison of Groups 1 and 2 as an example, I’m thinking that I may not fully understand how to set the parameters for a comparison of groups 1 and 3.
Any assistance is appreciated.
Thanks
Carol
|
Administrator
|
Hello Carol. Is your data structurally identical to that for the example on the website? Or are you just using the analysis on that site as a model for something that's a bit different? I ask, because the group12 variable in your syntax is confusing me. Perhaps if you gave more info about your data and the nature of the model (how many factors, etc), assuming it's not the same as the website example.
Re the example at http://www.ats.ucla.edu/stat/spss/library/hetreg.htm#heading5, here are the LMATRIX sub-commands with numbers added to make it easier to refer to them below. (This will be easier to read with a fixed font.) 1 /lmatrix "diet 1 vs 2 at 59 inches" diet -1 1 0 diet*height -59 59 0 2 /lmatrix "diet 1 vs 2 at 64 inches" diet -1 1 0 diet*height -64 64 0 3 /lmatrix "diet 1 vs 2 at 68 inches" diet -1 1 0 diet*height -68 68 0 4 /lmatrix "wt for diet 1 at 59 inches" intercept 1 diet 1 0 0 diet*height 59 0 0 5 /lmatrix "wt for diet 1 at 64 inches" intercept 1 diet 1 0 0 diet*height 64 0 0 6 /lmatrix "wt for diet 1 at 68 inches" intercept 1 diet 1 0 0 diet*height 68 0 0 7 /lmatrix "wt for diet 2 at 59 inches" intercept 1 diet 0 1 0 diet*height 0 59 0 8 /lmatrix "wt for diet 2 at 64 inches" intercept 1 diet 0 1 0 diet*height 0 64 0 9 /lmatrix "wt for diet 2 at 68 inches" intercept 1 diet 0 1 0 diet*height 0 68 0 The first 3 are obtained by subtraction as follows: 4 /lmatrix intercept 1 diet 1 0 0 diet*height 59 0 0 7 /lmatrix intercept 1 diet 0 1 0 diet*height 0 59 0 ------------------------------------------------------ 4-7 0 1 -1 0 59 -59 0 5 /lmatrix intercept 1 diet 1 0 0 diet*height 64 0 0 8 /lmatrix intercept 1 diet 0 1 0 diet*height 0 64 0 ------------------------------------------------------ 5-8 0 1 -1 0 64 -64 0 6 /lmatrix intercept 1 diet 1 0 0 diet*height 68 0 0 9 /lmatrix intercept 1 diet 0 1 0 diet*height 0 68 0 ------------------------------------------------------ 6-9 0 1 -1 0 68 -68 0 You can find other examples like this in the list archives, many of them posted by Ryan Black. (Ryan, are you still reading this list? You've not posted anything in ages.) HTH.
--
Bruce Weaver bweaver@lakeheadu.ca http://sites.google.com/a/lakeheadu.ca/bweaver/ "When all else fails, RTFM." PLEASE NOTE THE FOLLOWING: 1. My Hotmail account is not monitored regularly. To send me an e-mail, please use the address shown above. 2. The SPSSX Discussion forum on Nabble is no longer linked to the SPSSX-L listserv administered by UGA (https://listserv.uga.edu/). |
Bruce,
The example is very similar to my data: 3 groups, 1 covariate, no other factors. it even has the same number of subjects per group.
This example is so similar in fact, that the *only* difference is that in the example, diet 1 has the slope that different from the other 2 groups. In my
data, it is group 3 that has the wonky slope. So, i've been studying this example.
The group12 variable was created so i could estimate a similar slope for groups 1 and 2 since a previous model showed there was no difference in the slopes between these groups.
I created the group12 varaible so that it was structured like this.
I ran a model to compare groups 1 and 2 using the mean of the covariate and it came out making complete sense.
My goal for the syntax i posted was to compare group 1 with group 3. Now i wonder if you hit the nail on the head with this group12 variable.
I noticed many of Ryan's postings when i went to the archives but i couldn't quite find something that nailed this. I confess that i don't use matrix language much, if ever, but once i got the results for the
first comparion, it started making sense.
Thanks much
Carol -----Original Message-----
From: SPSSX(r) Discussion [[hidden email]] On Behalf Of Bruce Weaver
Sent: Tuesday, September 24, 2013 2:02 PM
To: [hidden email]
Subject: Re: lmatrix
Hello Carol. Is your data structurally identical to that for the example on the website? Or are you just using the analysis on that site as a model for something that's a bit different? I ask, because the group12 variable in your syntax is confusing
me. Perhaps if you gave more info about your data and the nature of the model (how many factors, etc), assuming it's not the same as the website example.
Re the example at
http://www.ats.ucla.edu/stat/spss/library/hetreg.htm#heading5, here are the LMATRIX sub-commands with numbers added to make it easier to refer
to them below. (This will be easier to read with a fixed font.)
1 /lmatrix "diet 1 vs 2 at 59 inches" diet -1 1 0 diet*height -59 59 0
2 /lmatrix "diet 1 vs 2 at 64 inches" diet -1 1 0 diet*height -64 64 0
3 /lmatrix "diet 1 vs 2 at 68 inches" diet -1 1 0 diet*height -68 68 0
4 /lmatrix "wt for diet 1 at 59 inches" intercept 1 diet 1 0 0 diet*height
59 0 0
5 /lmatrix "wt for diet 1 at 64 inches" intercept 1 diet 1 0 0 diet*height
64 0 0
6 /lmatrix "wt for diet 1 at 68 inches" intercept 1 diet 1 0 0 diet*height
68 0 0
7 /lmatrix "wt for diet 2 at 59 inches" intercept 1 diet 0 1 0 diet*height 0
59 0
8 /lmatrix "wt for diet 2 at 64 inches" intercept 1 diet 0 1 0 diet*height 0
64 0
9 /lmatrix "wt for diet 2 at 68 inches" intercept 1 diet 0 1 0 diet*height 0
68 0
The first 3 are obtained by subtraction as follows:
4 /lmatrix intercept 1 diet 1 0 0 diet*height 59 0 0
7 /lmatrix intercept 1 diet 0 1 0 diet*height 0 59 0
------------------------------------------------------
4-7 0 1 -1 0 59 -59 0
5 /lmatrix intercept 1 diet 1 0 0 diet*height 64 0 0
8 /lmatrix intercept 1 diet 0 1 0 diet*height 0 64 0
------------------------------------------------------
5-8 0 1 -1 0 64 -64 0
6 /lmatrix intercept 1 diet 1 0 0 diet*height 68 0 0
9 /lmatrix intercept 1 diet 0 1 0 diet*height 0 68 0
------------------------------------------------------
6-9 0 1 -1 0 68 -68 0
You can find other examples like this in the list archives, many of them posted by Ryan Black. (Ryan, are you still reading this list? You've not posted anything in ages.)
HTH.
parisec wrote
> Hi all,
>
> I'm following the example from this website: Section 5. Perform tests
> with separate slopes for all diet groups.
>
> //www.ats.ucla.edu/stat/spss/library/hetreg.htm>
>
> Here is my syntax.
>
> glm DV by group group12 with Covariate
> /design group Covariate group12* Covariate
> /print parameter
> /LMATRIX "group 1 vs 3 at 20 Covariate" group 1 0 -1
> group12*Covariate 20 -20
> /LMATRIX "group 1 vs 3 at 26 Covariate" group 1 0 -1
> group12*Covariate
> 26 -26
> /LMATRIX "group 1 vs 3 at 32 Covariate" group 1 0 -1
> group12*Covariate
> 32 -32
>
>
> /LMATRIX "DV for group 1 at 20 Covariate" intercept 1 group 1 0 0
> Covariate 20 group12*Covariate 20 0
> /LMATRIX "DV for group 1 at 26 Covariate" intercept 1 group 1 0 0
> Covariate 26 group12*Covariate 26 0
> /LMATRIX "DV for group 1 at 32 Covariate" intercept 1 group 1 0 0
> Covariate 32 group12*Covariate 32 0
> /LMATRIX "DV for group 3 at 20 Covariate" intercept 1 group 0 0 1
> Covariate 20 group12*Covariate 0 20
> /LMATRIX "DV for group 3 at 26 Covariate" intercept 1 group 0 0 1
> Covariate 26 group12*Covariate 0 26
> /LMATRIX "DV for group 3 at 32 Covariate" intercept 1 group 0 0 1
> Covariate 32 group12*Covariate 0 32.
>
> It runs just fine.
>
> The results of the first 3 /LMATRIX commands make sense given the data.
> They are the differences between the groups at each of these values of
> the covariate. They seem a bit extreme considering the actual means
> but they could make sense.
>
> What has me puzzled is that the next 6 /LMATRIX commands are supposed
> to give the adjusted means for the groups at each of the levels of the
> covariate but they don't quite seem correct, especially for group 3.
> They are coming out negative which isn't possible for the data.
>
> Since I'm using a comparison of Groups 1 and 2 as an example, I'm
> thinking that I may not fully understand how to set the parameters for
> a comparison of groups 1 and 3.
>
> Any assistance is appreciated.
> Thanks
> Carol
-----
--
Bruce Weaver
"When all else fails, RTFM."
NOTE: My Hotmail account is not monitored regularly.
To send me an e-mail, please use the address shown above.
--
View this message in context: http://spssx-discussion.1045642.n5.nabble.com/lmatrix-tp5722198p5722199.html
Sent from the SPSSX Discussion mailing list archive at Nabble.com.
=====================
To manage your subscription to SPSSX-L, send a message to [hidden email] (not to SPSSX-L), with no body text except the command. To leave the list, send the command SIGNOFF SPSSX-L For a list of commands to manage subscriptions, send the command
INFO REFCARD
|
Administrator
|
I'm dashing this off in a hurry, because it's time to go home, so I hope I'm not making any mistakes. But it sounds like you want something along these lines:
/lmatrix "diet [1,2] minus 3 at 59 inches" diet .5 .5 -1 diet*height 29.5 29.5 -59 /lmatrix "diet [1,2] minus 3 at 64 inches" diet .5 .5 -1 diet*height 32 32 -64 /lmatrix "diet [1,2] minus 3 at 68 inches" diet .5 .5 -1 diet*height 34 34 -68 HTH.
--
Bruce Weaver bweaver@lakeheadu.ca http://sites.google.com/a/lakeheadu.ca/bweaver/ "When all else fails, RTFM." PLEASE NOTE THE FOLLOWING: 1. My Hotmail account is not monitored regularly. To send me an e-mail, please use the address shown above. 2. The SPSSX Discussion forum on Nabble is no longer linked to the SPSSX-L listserv administered by UGA (https://listserv.uga.edu/). |
Bruce
I appreciate your help. I gave that code some thought to start with on this. It appears that it compares groups 1 and 2 combined, with group 3. The comparison of interest is only group 1 versus group 3 without regards to group 2. Would this provide the same contrast? I've been working with this a bit more on and notice that when i swapped the last 2 numbers from /LMATRIX "DV for group 1 at 26 Covariate" intercept 1 group 1 0 0 Covariate 26 group12*Covariate 26 0 to /LMATRIX "DV for group 1 at 26 Covariate" intercept 1 group 1 0 0 Covariate 26 group12*Covariate 0 26 and /LMATRIX "DV for group 3 at 26 Covariate" intercept 1 group 0 0 1 Covariate 26 group12*Covariate 0 26 to /LMATRIX "DV for group 3 at 26 Covariate" intercept 1 group 0 0 1 Covariate 26 group12*Covariate 26 0 the values were at least no longer negative. but they just don't seem correct when comparing to the adjusted means printed by EMMEANS. I think it comes down to i'm not fully understanding how spss knows what to compare when only 2 values (0 26) are included when there are 3 groups to consider. Thanks -----Original Message----- From: SPSSX(r) Discussion [mailto:[hidden email]] On Behalf Of Bruce Weaver Sent: Tuesday, September 24, 2013 3:19 PM To: [hidden email] Subject: Re: lmatrix I'm dashing this off in a hurry, because it's time to go home, so I hope I'm not making any mistakes. But it sounds like you want something along these lines: /lmatrix "diet [1,2] minus 3 at 59 inches" diet .5 .5 -1 diet*height 29.5 29.5 -59 /lmatrix "diet [1,2] minus 3 at 64 inches" diet .5 .5 -1 diet*height 32 32 -64 /lmatrix "diet [1,2] minus 3 at 68 inches" diet .5 .5 -1 diet*height 34 34 -68 HTH. parisec wrote > Bruce, > > The example is very similar to my data: 3 groups, 1 covariate, no > other factors. it even has the same number of subjects per group. > > This example is so similar in fact, that the *only* difference is that > in the example, diet 1 has the slope that different from the other 2 groups. > In my data, it is group 3 that has the wonky slope. So, i've been > studying this example. > > > The group12 variable was created so i could estimate a similar slope > for groups 1 and 2 since a previous model showed there was no > difference in the slopes between these groups. > > I created the group12 varaible so that it was structured like this. > > > group Treatment Group * group12 Crosstabulation Count > group12 Total > .00 1.00 > group Treatment Group Group1 0 10 10 > Group 2 0 10 10 > Group 3 10 0 10 > Total 10 20 30 > > I ran a model to compare groups 1 and 2 using the mean of the > covariate and it came out making complete sense. > > My goal for the syntax i posted was to compare group 1 with group 3. > Now i wonder if you hit the nail on the head with this group12 variable. > > I noticed many of Ryan's postings when i went to the archives but i > couldn't quite find something that nailed this. I confess that i don't > use matrix language much, if ever, but once i got the results for the > first comparion, it started making sense. > > Thanks much > Carol > > > > > > > > > -----Original Message----- > From: SPSSX(r) Discussion [mailto: > SPSSX-L@.UGA > ] On Behalf Of Bruce Weaver > Sent: Tuesday, September 24, 2013 2:02 PM > To: > SPSSX-L@.UGA > Subject: Re: lmatrix > > Hello Carol. Is your data structurally identical to that for the > example on the website? Or are you just using the analysis on that > site as a model for something that's a bit different? I ask, because > the group12 variable in your syntax is confusing me. Perhaps if you > gave more info about your data and the nature of the model (how many > factors, etc), assuming it's not the same as the website example. > > Re the example at > http://www.ats.ucla.edu/stat/spss/library/hetreg.htm#heading5, here > are the LMATRIX sub-commands with numbers added to make it easier to > refer to them below. (This will be easier to read with a fixed font.) > > 1 /lmatrix "diet 1 vs 2 at 59 inches" diet -1 1 0 diet*height -59 59 0 > 2 /lmatrix "diet 1 vs 2 at 64 inches" diet -1 1 0 diet*height -64 64 0 > 3 /lmatrix "diet 1 vs 2 at 68 inches" diet -1 1 0 diet*height -68 68 0 > 4 /lmatrix "wt for diet 1 at 59 inches" intercept 1 diet 1 0 0 > diet*height > 59 0 0 > 5 /lmatrix "wt for diet 1 at 64 inches" intercept 1 diet 1 0 0 > diet*height > 64 0 0 > 6 /lmatrix "wt for diet 1 at 68 inches" intercept 1 diet 1 0 0 > diet*height > 68 0 0 > 7 /lmatrix "wt for diet 2 at 59 inches" intercept 1 diet 0 1 0 > diet*height 0 > 59 0 > 8 /lmatrix "wt for diet 2 at 64 inches" intercept 1 diet 0 1 0 > diet*height 0 > 64 0 > 9 /lmatrix "wt for diet 2 at 68 inches" intercept 1 diet 0 1 0 > diet*height 0 > 68 0 > > > The first 3 are obtained by subtraction as follows: > > 4 /lmatrix intercept 1 diet 1 0 0 diet*height 59 0 0 > 7 /lmatrix intercept 1 diet 0 1 0 diet*height 0 59 0 > ------------------------------------------------------ > 4-7 0 1 -1 0 59 -59 0 > > > 5 /lmatrix intercept 1 diet 1 0 0 diet*height 64 0 0 > 8 /lmatrix intercept 1 diet 0 1 0 diet*height 0 64 0 > ------------------------------------------------------ > 5-8 0 1 -1 0 64 -64 0 > > > 6 /lmatrix intercept 1 diet 1 0 0 diet*height 68 0 0 > 9 /lmatrix intercept 1 diet 0 1 0 diet*height 0 68 0 > ------------------------------------------------------ > 6-9 0 1 -1 0 68 -68 0 > > > You can find other examples like this in the list archives, many of > them posted by Ryan Black. (Ryan, are you still reading this list? > You've not posted anything in ages.) > > HTH. > > > > > > parisec wrote >> Hi all, >> >> I'm following the example from this website: Section 5. Perform tests >> with separate slopes for all diet groups. >> >> http://www.ats.ucla.edu/stat/spss/library/hetreg.htm#heading3<http: >> //www.ats.ucla.edu/stat/spss/library/hetreg.htm> >> >> Here is my syntax. >> >> glm DV by group group12 with Covariate >> /design group Covariate group12* Covariate >> /print parameter >> /LMATRIX "group 1 vs 3 at 20 Covariate" group 1 0 -1 >> group12*Covariate 20 -20 >> /LMATRIX "group 1 vs 3 at 26 Covariate" group 1 0 -1 >> group12*Covariate >> 26 -26 >> /LMATRIX "group 1 vs 3 at 32 Covariate" group 1 0 -1 >> group12*Covariate >> 32 -32 >> >> >> /LMATRIX "DV for group 1 at 20 Covariate" intercept 1 group 1 0 0 >> Covariate 20 group12*Covariate 20 0 >> /LMATRIX "DV for group 1 at 26 Covariate" intercept 1 group 1 0 0 >> Covariate 26 group12*Covariate 26 0 >> /LMATRIX "DV for group 1 at 32 Covariate" intercept 1 group 1 0 0 >> Covariate 32 group12*Covariate 32 0 >> /LMATRIX "DV for group 3 at 20 Covariate" intercept 1 group 0 0 1 >> Covariate 20 group12*Covariate 0 20 >> /LMATRIX "DV for group 3 at 26 Covariate" intercept 1 group 0 0 1 >> Covariate 26 group12*Covariate 0 26 >> /LMATRIX "DV for group 3 at 32 Covariate" intercept 1 group 0 0 1 >> Covariate 32 group12*Covariate 0 32. >> >> It runs just fine. >> >> The results of the first 3 /LMATRIX commands make sense given the data. >> They are the differences between the groups at each of these values >> of the covariate. They seem a bit extreme considering the actual >> means but they could make sense. >> >> What has me puzzled is that the next 6 /LMATRIX commands are >> supposed to give the adjusted means for the groups at each of the >> levels of the covariate but they don't quite seem correct, especially for group 3. >> They are coming out negative which isn't possible for the data. >> >> Since I'm using a comparison of Groups 1 and 2 as an example, I'm >> thinking that I may not fully understand how to set the parameters >> for a comparison of groups 1 and 3. >> >> Any assistance is appreciated. >> Thanks >> Carol > > > > > > ----- > -- > Bruce Weaver > bweaver@ > http://sites.google.com/a/lakeheadu.ca/bweaver/ > > "When all else fails, RTFM." > > NOTE: My Hotmail account is not monitored regularly. > To send me an e-mail, please use the address shown above. > > -- > View this message in context: > http://spssx-discussion.1045642.n5.nabble.com/lmatrix-tp5722198p572219 > 9.html Sent from the SPSSX Discussion mailing list archive at > Nabble.com. > > ===================== > To manage your subscription to SPSSX-L, send a message to > LISTSERV@.UGA > (not to SPSSX-L), with no body text except the command. To leave the > list, send the command SIGNOFF SPSSX-L For a list of commands to > manage subscriptions, send the command INFO REFCARD ----- -- Bruce Weaver [hidden email] http://sites.google.com/a/lakeheadu.ca/bweaver/ "When all else fails, RTFM." NOTE: My Hotmail account is not monitored regularly. To send me an e-mail, please use the address shown above. -- View this message in context: http://spssx-discussion.1045642.n5.nabble.com/lmatrix-tp5722198p5722201.html Sent from the SPSSX Discussion mailing list archive at Nabble.com. ===================== To manage your subscription to SPSSX-L, send a message to [hidden email] (not to SPSSX-L), with no body text except the command. To leave the list, send the command SIGNOFF SPSSX-L For a list of commands to manage subscriptions, send the command INFO REFCARD ===================== To manage your subscription to SPSSX-L, send a message to [hidden email] (not to SPSSX-L), with no body text except the command. To leave the list, send the command SIGNOFF SPSSX-L For a list of commands to manage subscriptions, send the command INFO REFCARD |
Administrator
|
Sorry, I thought you wanted to contrast 1 and 2 combined with 3. But for 1 vs 3, just follow the same steps as before.
View in a fixed font. First, the fitted values for the 3 groups with 3 different values of the covariate: 1 /lmatrix "wt for diet 1 at 59 inches" intercept 1 diet 1 0 0 diet*height 59 0 0 2 /lmatrix "wt for diet 1 at 64 inches" intercept 1 diet 1 0 0 diet*height 64 0 0 3 /lmatrix "wt for diet 1 at 68 inches" intercept 1 diet 1 0 0 diet*height 68 0 0 4 /lmatrix "wt for diet 2 at 59 inches" intercept 1 diet 0 1 0 diet*height 0 59 0 5 /lmatrix "wt for diet 2 at 64 inches" intercept 1 diet 0 1 0 diet*height 0 64 0 6 /lmatrix "wt for diet 2 at 68 inches" intercept 1 diet 0 1 0 diet*height 0 68 0 7 /lmatrix "wt for diet 3 at 59 inches" intercept 1 diet 0 0 1 diet*height 0 0 59 8 /lmatrix "wt for diet 3 at 64 inches" intercept 1 diet 0 0 1 diet*height 0 0 64 9 /lmatrix "wt for diet 3 at 68 inches" intercept 1 diet 0 0 1 diet*height 0 0 68 Now the 1 v 3 contrasts: 1 /lmatrix "wt for diet 1 at 59 inches" intercept 1 diet 1 0 0 diet*height 59 0 0 7 /lmatrix "wt for diet 3 at 59 inches" intercept 1 diet 0 0 1 diet*height 0 0 59 ------------------------------------------------------------------------------- 1-7 0 1 0 -1 59 0 -59 2 /lmatrix "wt for diet 1 at 64 inches" intercept 1 diet 1 0 0 diet*height 64 0 0 8 /lmatrix "wt for diet 3 at 64 inches" intercept 1 diet 0 0 1 diet*height 0 0 64 ------------------------------------------------------------------------------- 2-8 0 1 0 -1 64 0 -64 3 /lmatrix "wt for diet 1 at 68 inches" intercept 1 diet 1 0 0 diet*height 68 0 0 9 /lmatrix "wt for diet 3 at 68 inches" intercept 1 diet 0 0 1 diet*height 0 0 68 ------------------------------------------------------------------------------- 3-9 0 1 0 -1 68 0 -68 HTH.
--
Bruce Weaver bweaver@lakeheadu.ca http://sites.google.com/a/lakeheadu.ca/bweaver/ "When all else fails, RTFM." PLEASE NOTE THE FOLLOWING: 1. My Hotmail account is not monitored regularly. To send me an e-mail, please use the address shown above. 2. The SPSSX Discussion forum on Nabble is no longer linked to the SPSSX-L listserv administered by UGA (https://listserv.uga.edu/). |
Hi Bruce,
** 1 /lmatrix "wt for diet 1 at 59 inches" intercept 1 diet 1 0 0 diet*height 59 0 0 ** the example on the website has only 59 0 at the end. This version makes more sense to me because there are 3 groups, therefore 59 0 0 seems logical. The version above gives me the error: "cannot form the estimable function for this L matrix because the number of values specified after at least one of effect on the LMATRIX subcommands is not equal to the number of parameters for that effect. Hypothesis tests cannot be computed." But when the code runs correctly, it is giving me illogical means. I'm hoping someone can explain how SPSS knows that 59 0 means "give me the mean for group 1 @ 59 inches" when there are 3 groups being considered. I'm thinking that by understanding the code a bit better, i can figure out what i need to do to get means that are within the realm of my data. Thanks Carol ________________________________________ From: SPSSX(r) Discussion [[hidden email]] On Behalf Of Bruce Weaver [[hidden email]] Sent: Tuesday, September 24, 2013 5:48 PM To: [hidden email] Subject: Re: lmatrix Sorry, I thought you wanted to contrast 1 and 2 combined with 3. But for 1 vs 3, just follow the same steps as before. View in a fixed font. First, the fitted values for the 3 groups with 3 different values of the covariate: 1 /lmatrix "wt for diet 1 at 59 inches" intercept 1 diet 1 0 0 diet*height 59 0 0 2 /lmatrix "wt for diet 1 at 64 inches" intercept 1 diet 1 0 0 diet*height 64 0 0 3 /lmatrix "wt for diet 1 at 68 inches" intercept 1 diet 1 0 0 diet*height 68 0 0 4 /lmatrix "wt for diet 2 at 59 inches" intercept 1 diet 0 1 0 diet*height 0 59 0 5 /lmatrix "wt for diet 2 at 64 inches" intercept 1 diet 0 1 0 diet*height 0 64 0 6 /lmatrix "wt for diet 2 at 68 inches" intercept 1 diet 0 1 0 diet*height 0 68 0 7 /lmatrix "wt for diet 3 at 59 inches" intercept 1 diet 0 0 1 diet*height 0 0 59 8 /lmatrix "wt for diet 3 at 64 inches" intercept 1 diet 0 0 1 diet*height 0 0 64 9 /lmatrix "wt for diet 3 at 68 inches" intercept 1 diet 0 0 1 diet*height 0 0 68 Now the 1 v 3 contrasts: 1 /lmatrix "wt for diet 1 at 59 inches" intercept 1 diet 1 0 0 diet*height 59 0 0 7 /lmatrix "wt for diet 3 at 59 inches" intercept 1 diet 0 0 1 diet*height 0 0 59 ------------------------------------------------------------------------------- 1-7 0 1 0 -1 59 0 -59 2 /lmatrix "wt for diet 1 at 64 inches" intercept 1 diet 1 0 0 diet*height 64 0 0 8 /lmatrix "wt for diet 3 at 64 inches" intercept 1 diet 0 0 1 diet*height 0 0 64 ------------------------------------------------------------------------------- 2-8 0 1 0 -1 64 0 -64 3 /lmatrix "wt for diet 1 at 68 inches" intercept 1 diet 1 0 0 diet*height 68 0 0 9 /lmatrix "wt for diet 3 at 68 inches" intercept 1 diet 0 0 1 diet*height 0 0 68 ------------------------------------------------------------------------------- 3-9 0 1 0 -1 68 0 -68 HTH. parisec wrote > Bruce > > I appreciate your help. > > I gave that code some thought to start with on this. It appears that it > compares groups 1 and 2 combined, with group 3. The comparison of > interest is only group 1 versus group 3 without regards to group 2. > Would this provide the same contrast? > > > I've been working with this a bit more on and notice that when i swapped > the last 2 numbers from > > /LMATRIX "DV for group 1 at 26 Covariate" intercept 1 group 1 0 0 > Covariate 26 group12*Covariate 26 0 > > to > > /LMATRIX "DV for group 1 at 26 Covariate" intercept 1 group 1 0 0 > Covariate 26 group12*Covariate 0 26 > > and > > /LMATRIX "DV for group 3 at 26 Covariate" intercept 1 group 0 0 1 > Covariate 26 group12*Covariate 0 26 > to > > /LMATRIX "DV for group 3 at 26 Covariate" intercept 1 group 0 0 1 > Covariate 26 group12*Covariate 26 0 > > the values were at least no longer negative. but they just don't seem > correct when comparing to the adjusted means printed by EMMEANS. > > I think it comes down to i'm not fully understanding how spss knows what > to compare when only 2 values (0 26) are included when there are 3 groups > to consider. > > Thanks > > > > > -----Original Message----- > From: SPSSX(r) Discussion [mailto: > SPSSX-L@.UGA > ] On Behalf Of Bruce Weaver > Sent: Tuesday, September 24, 2013 3:19 PM > To: > SPSSX-L@.UGA > Subject: Re: lmatrix > > I'm dashing this off in a hurry, because it's time to go home, so I hope > I'm not making any mistakes. But it sounds like you want something along > these > lines: > > /lmatrix "diet [1,2] minus 3 at 59 inches" diet .5 .5 -1 diet*height 29.5 > 29.5 -59 > /lmatrix "diet [1,2] minus 3 at 64 inches" diet .5 .5 -1 diet*height 32 > 32 -64 > /lmatrix "diet [1,2] minus 3 at 68 inches" diet .5 .5 -1 diet*height 34 > 34 -68 > > HTH. > > > > parisec wrote >> Bruce, >> >> The example is very similar to my data: 3 groups, 1 covariate, no >> other factors. it even has the same number of subjects per group. >> >> This example is so similar in fact, that the *only* difference is that >> in the example, diet 1 has the slope that different from the other 2 >> groups. >> In my data, it is group 3 that has the wonky slope. So, i've been >> studying this example. >> >> >> The group12 variable was created so i could estimate a similar slope >> for groups 1 and 2 since a previous model showed there was no >> difference in the slopes between these groups. >> >> I created the group12 varaible so that it was structured like this. >> >> >> group Treatment Group * group12 Crosstabulation Count >> group12 Total >> .00 1.00 >> group Treatment Group Group1 0 10 10 >> Group 2 0 10 10 >> Group 3 10 0 10 >> Total 10 20 30 >> >> I ran a model to compare groups 1 and 2 using the mean of the >> covariate and it came out making complete sense. >> >> My goal for the syntax i posted was to compare group 1 with group 3. >> Now i wonder if you hit the nail on the head with this group12 variable. >> >> I noticed many of Ryan's postings when i went to the archives but i >> couldn't quite find something that nailed this. I confess that i don't >> use matrix language much, if ever, but once i got the results for the >> first comparion, it started making sense. >> >> Thanks much >> Carol >> >> >> >> >> >> >> >> >> -----Original Message----- >> From: SPSSX(r) Discussion [mailto: > >> SPSSX-L@.UGA > >> ] On Behalf Of Bruce Weaver >> Sent: Tuesday, September 24, 2013 2:02 PM >> To: > >> SPSSX-L@.UGA > >> Subject: Re: lmatrix >> >> Hello Carol. Is your data structurally identical to that for the >> example on the website? Or are you just using the analysis on that >> site as a model for something that's a bit different? I ask, because >> the group12 variable in your syntax is confusing me. Perhaps if you >> gave more info about your data and the nature of the model (how many >> factors, etc), assuming it's not the same as the website example. >> >> Re the example at >> http://www.ats.ucla.edu/stat/spss/library/hetreg.htm#heading5, here >> are the LMATRIX sub-commands with numbers added to make it easier to >> refer to them below. (This will be easier to read with a fixed font.) >> >> 1 /lmatrix "diet 1 vs 2 at 59 inches" diet -1 1 0 diet*height -59 59 0 >> 2 /lmatrix "diet 1 vs 2 at 64 inches" diet -1 1 0 diet*height -64 64 0 >> 3 /lmatrix "diet 1 vs 2 at 68 inches" diet -1 1 0 diet*height -68 68 0 >> 4 /lmatrix "wt for diet 1 at 59 inches" intercept 1 diet 1 0 0 >> diet*height >> 59 0 0 >> 5 /lmatrix "wt for diet 1 at 64 inches" intercept 1 diet 1 0 0 >> diet*height >> 64 0 0 >> 6 /lmatrix "wt for diet 1 at 68 inches" intercept 1 diet 1 0 0 >> diet*height >> 68 0 0 >> 7 /lmatrix "wt for diet 2 at 59 inches" intercept 1 diet 0 1 0 >> diet*height 0 >> 59 0 >> 8 /lmatrix "wt for diet 2 at 64 inches" intercept 1 diet 0 1 0 >> diet*height 0 >> 64 0 >> 9 /lmatrix "wt for diet 2 at 68 inches" intercept 1 diet 0 1 0 >> diet*height 0 >> 68 0 >> >> >> The first 3 are obtained by subtraction as follows: >> >> 4 /lmatrix intercept 1 diet 1 0 0 diet*height 59 0 0 >> 7 /lmatrix intercept 1 diet 0 1 0 diet*height 0 59 0 >> ------------------------------------------------------ >> 4-7 0 1 -1 0 59 -59 0 >> >> >> 5 /lmatrix intercept 1 diet 1 0 0 diet*height 64 0 0 >> 8 /lmatrix intercept 1 diet 0 1 0 diet*height 0 64 0 >> ------------------------------------------------------ >> 5-8 0 1 -1 0 64 -64 0 >> >> >> 6 /lmatrix intercept 1 diet 1 0 0 diet*height 68 0 0 >> 9 /lmatrix intercept 1 diet 0 1 0 diet*height 0 68 0 >> ------------------------------------------------------ >> 6-9 0 1 -1 0 68 -68 0 >> >> >> You can find other examples like this in the list archives, many of >> them posted by Ryan Black. (Ryan, are you still reading this list? >> You've not posted anything in ages.) >> >> HTH. >> >> >> >> >> >> parisec wrote >>> Hi all, >>> >>> I'm following the example from this website: Section 5. Perform tests >>> with separate slopes for all diet groups. >>> >>> http://www.ats.ucla.edu/stat/spss/library/hetreg.htm#heading3<http: >>> //www.ats.ucla.edu/stat/spss/library/hetreg.htm> >>> >>> Here is my syntax. >>> >>> glm DV by group group12 with Covariate >>> /design group Covariate group12* Covariate >>> /print parameter >>> /LMATRIX "group 1 vs 3 at 20 Covariate" group 1 0 -1 >>> group12*Covariate 20 -20 >>> /LMATRIX "group 1 vs 3 at 26 Covariate" group 1 0 -1 >>> group12*Covariate >>> 26 -26 >>> /LMATRIX "group 1 vs 3 at 32 Covariate" group 1 0 -1 >>> group12*Covariate >>> 32 -32 >>> >>> >>> /LMATRIX "DV for group 1 at 20 Covariate" intercept 1 group 1 0 0 >>> Covariate 20 group12*Covariate 20 0 >>> /LMATRIX "DV for group 1 at 26 Covariate" intercept 1 group 1 0 0 >>> Covariate 26 group12*Covariate 26 0 >>> /LMATRIX "DV for group 1 at 32 Covariate" intercept 1 group 1 0 0 >>> Covariate 32 group12*Covariate 32 0 >>> /LMATRIX "DV for group 3 at 20 Covariate" intercept 1 group 0 0 1 >>> Covariate 20 group12*Covariate 0 20 >>> /LMATRIX "DV for group 3 at 26 Covariate" intercept 1 group 0 0 1 >>> Covariate 26 group12*Covariate 0 26 >>> /LMATRIX "DV for group 3 at 32 Covariate" intercept 1 group 0 0 1 >>> Covariate 32 group12*Covariate 0 32. >>> >>> It runs just fine. >>> >>> The results of the first 3 /LMATRIX commands make sense given the data. >>> They are the differences between the groups at each of these values >>> of the covariate. They seem a bit extreme considering the actual >>> means but they could make sense. >>> >>> What has me puzzled is that the next 6 /LMATRIX commands are >>> supposed to give the adjusted means for the groups at each of the >>> levels of the covariate but they don't quite seem correct, especially >>> for group 3. >>> They are coming out negative which isn't possible for the data. >>> >>> Since I'm using a comparison of Groups 1 and 2 as an example, I'm >>> thinking that I may not fully understand how to set the parameters >>> for a comparison of groups 1 and 3. >>> >>> Any assistance is appreciated. >>> Thanks >>> Carol >> >> >> >> >> >> ----- >> -- >> Bruce Weaver > >> bweaver@ > >> http://sites.google.com/a/lakeheadu.ca/bweaver/ >> >> "When all else fails, RTFM." >> >> NOTE: My Hotmail account is not monitored regularly. >> To send me an e-mail, please use the address shown above. >> >> -- >> View this message in context: >> http://spssx-discussion.1045642.n5.nabble.com/lmatrix-tp5722198p572219 >> 9.html Sent from the SPSSX Discussion mailing list archive at >> Nabble.com. >> >> ===================== >> To manage your subscription to SPSSX-L, send a message to > >> LISTSERV@.UGA > >> (not to SPSSX-L), with no body text except the command. To leave the >> list, send the command SIGNOFF SPSSX-L For a list of commands to >> manage subscriptions, send the command INFO REFCARD > > > > > > ----- > -- > Bruce Weaver > bweaver@ > http://sites.google.com/a/lakeheadu.ca/bweaver/ > > "When all else fails, RTFM." > > NOTE: My Hotmail account is not monitored regularly. > To send me an e-mail, please use the address shown above. > > -- > View this message in context: > http://spssx-discussion.1045642.n5.nabble.com/lmatrix-tp5722198p5722201.html > Sent from the SPSSX Discussion mailing list archive at Nabble.com. > > ===================== > To manage your subscription to SPSSX-L, send a message to > LISTSERV@.UGA > (not to SPSSX-L), with no body text except the command. To leave the > list, send the command SIGNOFF SPSSX-L For a list of commands to manage > subscriptions, send the command INFO REFCARD > > ===================== > To manage your subscription to SPSSX-L, send a message to > LISTSERV@.UGA > (not to SPSSX-L), with no body text except the > command. To leave the list, send the command > SIGNOFF SPSSX-L > For a list of commands to manage subscriptions, send the command > INFO REFCARD ----- -- Bruce Weaver [hidden email] http://sites.google.com/a/lakeheadu.ca/bweaver/ "When all else fails, RTFM." NOTE: My Hotmail account is not monitored regularly. To send me an e-mail, please use the address shown above. -- View this message in context: http://spssx-discussion.1045642.n5.nabble.com/lmatrix-tp5722198p5722207.html Sent from the SPSSX Discussion mailing list archive at Nabble.com. ===================== To manage your subscription to SPSSX-L, send a message to [hidden email] (not to SPSSX-L), with no body text except the command. To leave the list, send the command SIGNOFF SPSSX-L For a list of commands to manage subscriptions, send the command INFO REFCARD ===================== To manage your subscription to SPSSX-L, send a message to [hidden email] (not to SPSSX-L), with no body text except the command. To leave the list, send the command SIGNOFF SPSSX-L For a list of commands to manage subscriptions, send the command INFO REFCARD |
In reply to this post by Bruce Weaver
I may have stumbled upon the answer.
The following is an example for finding the adjusted means when the 2 groups being compared have similar slopes. The key thing here is the |diet23*height 0 63.13 | Note that they are both in the same order even though the first line is looking for the the mean of group 2 and the second one is looking for the mean of group 3. /lmatrix "diet 2 at xbar" intercept 1 diet 0 1 0 height 63.13 diet23*height 0 63.13 /lmatrix "diet 3 at xbar" intercept 1 diet 0 0 1 height 63.13 diet23*height 0 63.13. My original syntax uses this format: /lmatrix "diet 2 at xbar" intercept 1 diet 1 0 0 height 63.13 diet23*height 63.13 0 /lmatrix "diet 3 at xbar" intercept 1 diet 0 0 1 height 63.13 diet23*height 0 63.13. ...where i flopped the numbers at the end. My 'diet 2" means come out normally, it's the diet 3 means that don't make sense. So i ran all of the code so that it followed the 63.13 0 patten like my "diet 2" group and the means come out rationally. ________________________________________ From: SPSSX(r) Discussion [[hidden email]] On Behalf Of Bruce Weaver [[hidden email]] Sent: Tuesday, September 24, 2013 5:48 PM To: [hidden email] Subject: Re: lmatrix Sorry, I thought you wanted to contrast 1 and 2 combined with 3. But for 1 vs 3, just follow the same steps as before. View in a fixed font. First, the fitted values for the 3 groups with 3 different values of the covariate: 1 /lmatrix "wt for diet 1 at 59 inches" intercept 1 diet 1 0 0 diet*height 59 0 0 2 /lmatrix "wt for diet 1 at 64 inches" intercept 1 diet 1 0 0 diet*height 64 0 0 3 /lmatrix "wt for diet 1 at 68 inches" intercept 1 diet 1 0 0 diet*height 68 0 0 4 /lmatrix "wt for diet 2 at 59 inches" intercept 1 diet 0 1 0 diet*height 0 59 0 5 /lmatrix "wt for diet 2 at 64 inches" intercept 1 diet 0 1 0 diet*height 0 64 0 6 /lmatrix "wt for diet 2 at 68 inches" intercept 1 diet 0 1 0 diet*height 0 68 0 7 /lmatrix "wt for diet 3 at 59 inches" intercept 1 diet 0 0 1 diet*height 0 0 59 8 /lmatrix "wt for diet 3 at 64 inches" intercept 1 diet 0 0 1 diet*height 0 0 64 9 /lmatrix "wt for diet 3 at 68 inches" intercept 1 diet 0 0 1 diet*height 0 0 68 Now the 1 v 3 contrasts: 1 /lmatrix "wt for diet 1 at 59 inches" intercept 1 diet 1 0 0 diet*height 59 0 0 7 /lmatrix "wt for diet 3 at 59 inches" intercept 1 diet 0 0 1 diet*height 0 0 59 ------------------------------------------------------------------------------- 1-7 0 1 0 -1 59 0 -59 2 /lmatrix "wt for diet 1 at 64 inches" intercept 1 diet 1 0 0 diet*height 64 0 0 8 /lmatrix "wt for diet 3 at 64 inches" intercept 1 diet 0 0 1 diet*height 0 0 64 ------------------------------------------------------------------------------- 2-8 0 1 0 -1 64 0 -64 3 /lmatrix "wt for diet 1 at 68 inches" intercept 1 diet 1 0 0 diet*height 68 0 0 9 /lmatrix "wt for diet 3 at 68 inches" intercept 1 diet 0 0 1 diet*height 0 0 68 ------------------------------------------------------------------------------- 3-9 0 1 0 -1 68 0 -68 HTH. parisec wrote > Bruce > > I appreciate your help. > > I gave that code some thought to start with on this. It appears that it > compares groups 1 and 2 combined, with group 3. The comparison of > interest is only group 1 versus group 3 without regards to group 2. > Would this provide the same contrast? > > > I've been working with this a bit more on and notice that when i swapped > the last 2 numbers from > > /LMATRIX "DV for group 1 at 26 Covariate" intercept 1 group 1 0 0 > Covariate 26 group12*Covariate 26 0 > > to > > /LMATRIX "DV for group 1 at 26 Covariate" intercept 1 group 1 0 0 > Covariate 26 group12*Covariate 0 26 > > and > > /LMATRIX "DV for group 3 at 26 Covariate" intercept 1 group 0 0 1 > Covariate 26 group12*Covariate 0 26 > to > > /LMATRIX "DV for group 3 at 26 Covariate" intercept 1 group 0 0 1 > Covariate 26 group12*Covariate 26 0 > > the values were at least no longer negative. but they just don't seem > correct when comparing to the adjusted means printed by EMMEANS. > > I think it comes down to i'm not fully understanding how spss knows what > to compare when only 2 values (0 26) are included when there are 3 groups > to consider. > > Thanks > > > > > -----Original Message----- > From: SPSSX(r) Discussion [mailto: > SPSSX-L@.UGA > ] On Behalf Of Bruce Weaver > Sent: Tuesday, September 24, 2013 3:19 PM > To: > SPSSX-L@.UGA > Subject: Re: lmatrix > > I'm dashing this off in a hurry, because it's time to go home, so I hope > I'm not making any mistakes. But it sounds like you want something along > these > lines: > > /lmatrix "diet [1,2] minus 3 at 59 inches" diet .5 .5 -1 diet*height 29.5 > 29.5 -59 > /lmatrix "diet [1,2] minus 3 at 64 inches" diet .5 .5 -1 diet*height 32 > 32 -64 > /lmatrix "diet [1,2] minus 3 at 68 inches" diet .5 .5 -1 diet*height 34 > 34 -68 > > HTH. > > > > parisec wrote >> Bruce, >> >> The example is very similar to my data: 3 groups, 1 covariate, no >> other factors. it even has the same number of subjects per group. >> >> This example is so similar in fact, that the *only* difference is that >> in the example, diet 1 has the slope that different from the other 2 >> groups. >> In my data, it is group 3 that has the wonky slope. So, i've been >> studying this example. >> >> >> The group12 variable was created so i could estimate a similar slope >> for groups 1 and 2 since a previous model showed there was no >> difference in the slopes between these groups. >> >> I created the group12 varaible so that it was structured like this. >> >> >> group Treatment Group * group12 Crosstabulation Count >> group12 Total >> .00 1.00 >> group Treatment Group Group1 0 10 10 >> Group 2 0 10 10 >> Group 3 10 0 10 >> Total 10 20 30 >> >> I ran a model to compare groups 1 and 2 using the mean of the >> covariate and it came out making complete sense. >> >> My goal for the syntax i posted was to compare group 1 with group 3. >> Now i wonder if you hit the nail on the head with this group12 variable. >> >> I noticed many of Ryan's postings when i went to the archives but i >> couldn't quite find something that nailed this. I confess that i don't >> use matrix language much, if ever, but once i got the results for the >> first comparion, it started making sense. >> >> Thanks much >> Carol >> >> >> >> >> >> >> >> >> -----Original Message----- >> From: SPSSX(r) Discussion [mailto: > >> SPSSX-L@.UGA > >> ] On Behalf Of Bruce Weaver >> Sent: Tuesday, September 24, 2013 2:02 PM >> To: > >> SPSSX-L@.UGA > >> Subject: Re: lmatrix >> >> Hello Carol. Is your data structurally identical to that for the >> example on the website? Or are you just using the analysis on that >> site as a model for something that's a bit different? I ask, because >> the group12 variable in your syntax is confusing me. Perhaps if you >> gave more info about your data and the nature of the model (how many >> factors, etc), assuming it's not the same as the website example. >> >> Re the example at >> http://www.ats.ucla.edu/stat/spss/library/hetreg.htm#heading5, here >> are the LMATRIX sub-commands with numbers added to make it easier to >> refer to them below. (This will be easier to read with a fixed font.) >> >> 1 /lmatrix "diet 1 vs 2 at 59 inches" diet -1 1 0 diet*height -59 59 0 >> 2 /lmatrix "diet 1 vs 2 at 64 inches" diet -1 1 0 diet*height -64 64 0 >> 3 /lmatrix "diet 1 vs 2 at 68 inches" diet -1 1 0 diet*height -68 68 0 >> 4 /lmatrix "wt for diet 1 at 59 inches" intercept 1 diet 1 0 0 >> diet*height >> 59 0 0 >> 5 /lmatrix "wt for diet 1 at 64 inches" intercept 1 diet 1 0 0 >> diet*height >> 64 0 0 >> 6 /lmatrix "wt for diet 1 at 68 inches" intercept 1 diet 1 0 0 >> diet*height >> 68 0 0 >> 7 /lmatrix "wt for diet 2 at 59 inches" intercept 1 diet 0 1 0 >> diet*height 0 >> 59 0 >> 8 /lmatrix "wt for diet 2 at 64 inches" intercept 1 diet 0 1 0 >> diet*height 0 >> 64 0 >> 9 /lmatrix "wt for diet 2 at 68 inches" intercept 1 diet 0 1 0 >> diet*height 0 >> 68 0 >> >> >> The first 3 are obtained by subtraction as follows: >> >> 4 /lmatrix intercept 1 diet 1 0 0 diet*height 59 0 0 >> 7 /lmatrix intercept 1 diet 0 1 0 diet*height 0 59 0 >> ------------------------------------------------------ >> 4-7 0 1 -1 0 59 -59 0 >> >> >> 5 /lmatrix intercept 1 diet 1 0 0 diet*height 64 0 0 >> 8 /lmatrix intercept 1 diet 0 1 0 diet*height 0 64 0 >> ------------------------------------------------------ >> 5-8 0 1 -1 0 64 -64 0 >> >> >> 6 /lmatrix intercept 1 diet 1 0 0 diet*height 68 0 0 >> 9 /lmatrix intercept 1 diet 0 1 0 diet*height 0 68 0 >> ------------------------------------------------------ >> 6-9 0 1 -1 0 68 -68 0 >> >> >> You can find other examples like this in the list archives, many of >> them posted by Ryan Black. (Ryan, are you still reading this list? >> You've not posted anything in ages.) >> >> HTH. >> >> >> >> >> >> parisec wrote >>> Hi all, >>> >>> I'm following the example from this website: Section 5. Perform tests >>> with separate slopes for all diet groups. >>> >>> http://www.ats.ucla.edu/stat/spss/library/hetreg.htm#heading3<http: >>> //www.ats.ucla.edu/stat/spss/library/hetreg.htm> >>> >>> Here is my syntax. >>> >>> glm DV by group group12 with Covariate >>> /design group Covariate group12* Covariate >>> /print parameter >>> /LMATRIX "group 1 vs 3 at 20 Covariate" group 1 0 -1 >>> group12*Covariate 20 -20 >>> /LMATRIX "group 1 vs 3 at 26 Covariate" group 1 0 -1 >>> group12*Covariate >>> 26 -26 >>> /LMATRIX "group 1 vs 3 at 32 Covariate" group 1 0 -1 >>> group12*Covariate >>> 32 -32 >>> >>> >>> /LMATRIX "DV for group 1 at 20 Covariate" intercept 1 group 1 0 0 >>> Covariate 20 group12*Covariate 20 0 >>> /LMATRIX "DV for group 1 at 26 Covariate" intercept 1 group 1 0 0 >>> Covariate 26 group12*Covariate 26 0 >>> /LMATRIX "DV for group 1 at 32 Covariate" intercept 1 group 1 0 0 >>> Covariate 32 group12*Covariate 32 0 >>> /LMATRIX "DV for group 3 at 20 Covariate" intercept 1 group 0 0 1 >>> Covariate 20 group12*Covariate 0 20 >>> /LMATRIX "DV for group 3 at 26 Covariate" intercept 1 group 0 0 1 >>> Covariate 26 group12*Covariate 0 26 >>> /LMATRIX "DV for group 3 at 32 Covariate" intercept 1 group 0 0 1 >>> Covariate 32 group12*Covariate 0 32. >>> >>> It runs just fine. >>> >>> The results of the first 3 /LMATRIX commands make sense given the data. >>> They are the differences between the groups at each of these values >>> of the covariate. They seem a bit extreme considering the actual >>> means but they could make sense. >>> >>> What has me puzzled is that the next 6 /LMATRIX commands are >>> supposed to give the adjusted means for the groups at each of the >>> levels of the covariate but they don't quite seem correct, especially >>> for group 3. >>> They are coming out negative which isn't possible for the data. >>> >>> Since I'm using a comparison of Groups 1 and 2 as an example, I'm >>> thinking that I may not fully understand how to set the parameters >>> for a comparison of groups 1 and 3. >>> >>> Any assistance is appreciated. >>> Thanks >>> Carol >> >> >> >> >> >> ----- >> -- >> Bruce Weaver > >> bweaver@ > >> http://sites.google.com/a/lakeheadu.ca/bweaver/ >> >> "When all else fails, RTFM." >> >> NOTE: My Hotmail account is not monitored regularly. >> To send me an e-mail, please use the address shown above. >> >> -- >> View this message in context: >> http://spssx-discussion.1045642.n5.nabble.com/lmatrix-tp5722198p572219 >> 9.html Sent from the SPSSX Discussion mailing list archive at >> Nabble.com. >> >> ===================== >> To manage your subscription to SPSSX-L, send a message to > >> LISTSERV@.UGA > >> (not to SPSSX-L), with no body text except the command. To leave the >> list, send the command SIGNOFF SPSSX-L For a list of commands to >> manage subscriptions, send the command INFO REFCARD > > > > > > ----- > -- > Bruce Weaver > bweaver@ > http://sites.google.com/a/lakeheadu.ca/bweaver/ > > "When all else fails, RTFM." > > NOTE: My Hotmail account is not monitored regularly. > To send me an e-mail, please use the address shown above. > > -- > View this message in context: > http://spssx-discussion.1045642.n5.nabble.com/lmatrix-tp5722198p5722201.html > Sent from the SPSSX Discussion mailing list archive at Nabble.com. > > ===================== > To manage your subscription to SPSSX-L, send a message to > LISTSERV@.UGA > (not to SPSSX-L), with no body text except the command. To leave the > list, send the command SIGNOFF SPSSX-L For a list of commands to manage > subscriptions, send the command INFO REFCARD > > ===================== > To manage your subscription to SPSSX-L, send a message to > LISTSERV@.UGA > (not to SPSSX-L), with no body text except the > command. To leave the list, send the command > SIGNOFF SPSSX-L > For a list of commands to manage subscriptions, send the command > INFO REFCARD ----- -- Bruce Weaver [hidden email] http://sites.google.com/a/lakeheadu.ca/bweaver/ "When all else fails, RTFM." NOTE: My Hotmail account is not monitored regularly. To send me an e-mail, please use the address shown above. -- View this message in context: http://spssx-discussion.1045642.n5.nabble.com/lmatrix-tp5722198p5722207.html Sent from the SPSSX Discussion mailing list archive at Nabble.com. ===================== To manage your subscription to SPSSX-L, send a message to [hidden email] (not to SPSSX-L), with no body text except the command. To leave the list, send the command SIGNOFF SPSSX-L For a list of commands to manage subscriptions, send the command INFO REFCARD ===================== To manage your subscription to SPSSX-L, send a message to [hidden email] (not to SPSSX-L), with no body text except the command. To leave the list, send the command SIGNOFF SPSSX-L For a list of commands to manage subscriptions, send the command INFO REFCARD |
Free forum by Nabble | Edit this page |