Bookmark and Share

Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: st: ordinal mixed effects model with interaction and quadratic terms


From   "Pritsch, Julian" <[email protected]>
To   "'[email protected]'" <[email protected]>
Subject   Re: st: ordinal mixed effects model with interaction and quadratic terms
Date   Sat, 29 Mar 2014 21:28:25 +0000

Dear Darthy,
Dear David,

Thanks for you comments. 

First I want to clear some things up: 
Darthy, I use Stata v.13. and I used the factor mode (sex##c.agez sex##age_sqz) to
enter the variables into my model.

David, you are a right, I z-standardized age-squared.

No back to my problem:
I used the -predict- command like you adviced, Darthy, but the problem is that I can not fix
covariats at a certain value when I use the -predict- command. If I understood correctly,
the -predict- command estimated prediced margins, entering observed values from every 
respondent. 

But do the predicted margins (using -predict-) help to answer the question if the age-effect
on my DV is different for male and female?




____________________________________________________________________
-David wrote:

Julian,

Your model should contain the interaction between sex and age_sqz.
The syntax suggested by Darcy may be one way to do it, though I think
you z-standardized age-squared, rather than squaring z-standardized
age.

What is the evidence (in the data) that the nonlinear effects of age
are quadratic (or reasonably well approximated by a quadratic)?
Nonlinear effects can take a variety of forms, and many (perhaps most)
of those forms are not quadratic.  You may be able to get your data to
point toward a suitable nonlinear form for age.



_______________________________________________________________________

Darthy answered:

You did not mention which version of Stata you are using. If you are using at least 12 or higher then you do not need to create an interaction variable, you can just add into the syntax "sex##c.agez" along with your independent variables. I'm not sure about versions prior to 12, but I don't think it is possible. If that is so and you have a version older than 12, then yes you will have to create the variable for the interaction.


For ordinal models, I haven't worked with predicted values the way you are describing in item 2 below. After running meologit (or meglm) I then use "predict Pr*, pr". The "Pr" is the stub for new variables of predicted probabilities for each category of an outcome variable. After running this, you will have 4 variables for each of your 4 categories of your outcome variable that will be named Pr0, Pr1, etc. (you can of course use a stub other than Pr). I then use these variables with the predicted probabilities to create plots. If you are interested in this I can send you examples of the syntax I've used and the resulting plots.


I hope that helps,
Darcy

_____________________________________________________________________

Julians original post:
Dear statalist-users,

I am estimating a ordinal multilevel model using the -meologit- command. My dependent variable has 4 categories (0-3).
In my Level-1 model I introduced a dummy for sex (sex) and a z-standardized version of age (agez). Additionally, I introduced and z-standardized squared-term of age (age_sqz) because I want to show non-linear effects of age on my DV.


My question is twofold:
(1)  I want to introduce an interaction term of sex & agez: Do I also need to form an interaction term of sex and the squared version of agez to specify my model correctly?

(2) After estimating my model I would like to find out (using the -marginsplot- command), if there are any differences  between male and female respondents regarding the age effect.

Regarding question (2) I tried the following:

---------------------code-----------------------------------------------
*for outcome(0)
margins sex, at(agez=(-1.88 -1.19 0.01 1.11 1.85)) vsquish ///
		  level(99) ///
		  predict(outcome(0) fixedonly)

--------------------------------------------------------------------------
*Note: the values for agez are the 2/15/50/85/98-percentile to represent -2SD/-1SD/ 0 /+1SD/+2SD


I repeat that syntax for every outcome(0,1,2,3) and will try to combine the graphs.

Is there a more elegant way to do this? And what about the interaction of sex and the squared term of age (age_sqz)

Any advice would be appreciated.

Julian

*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/faqs/resources/statalist-faq/
*   http://www.ats.ucla.edu/stat/stata/


© Copyright 1996–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index