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   Darcy Hannibal <[email protected]>
To   [email protected]
Subject   Re: st: ordinal mixed effects model with interaction and quadratic terms
Date   Fri, 28 Mar 2014 23:17:22 -0700

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

On 3/28/2014 12:59 PM, Pritsch, Julian wrote:
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
_________________

Julian Pritsch, Dipl.-Soz.

Max-Planck-Institut für ausländisches
und internationales Strafrecht
Günterstalstraße 73
79100 Freiburg i. Br.
Tel.: +49 (761) 7081-291
e-Mail: [email protected]
homepage: www.mpicc.de

Max-Planck-Institute for Foreign
and International Criminal Law
Guenterstalstrasse 73
79100 Freiburg i. Br.
Germany
Phone: +49 (761) 7081-291
e-Mail: [email protected]
homepage: www.mpicc.de



*
*   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/

--
Darcy L. Hannibal, PhD
Staff Research Associate III Supervisor

McCowan Animal Behavior Laboratory for Welfare and Conservation
Department of Population Health and Reproduction

Behavior Management
Brain, Mind, and Behavior Unit
California National Primate Research Center

University of California at Davis

Office: 3029-B CNPRC
Phone: 530-752-1586


---
This email is free from viruses and malware because avast! Antivirus protection is active.
http://www.avast.com

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