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: Marginal Effects using subsetted data
From
Kit Baum <[email protected]>
To
[email protected]
Subject
re: st: Marginal Effects using subsetted data
Date
Sun, 31 Oct 2010 16:37:17 -0400
<>
Nick said
I am running an ordered probit model using data that I wish to subset by
gender and race (both dichotomous measures). I am running the following
commands:
'by gender race, sort: ologit depvar indvars'
At that point, I get the correct output of 4 tables for the proper
combinations of the sorted variables (0,0)(0,1)(1,0)(1,1); however, when
I try to run marginal effects as:
'mfx, predict(p outcome(1))' (my depvar is 3 ordered categories)
I get the error:
'no observations
r(2000);'
clear all
set more off
sysuse auto
drop if rep78==1
su price,mean
g hip = price>r(mean)
forv p=0/1 {
forv f=0/1 {
di in r _n "High price==`p', Foreign==`f'"
oprobit rep78 turn mpg if hip==`p' & foreign==`f', nolog
mfx, predict(p outcome(#1))
}
}
Kit Baum | Boston College Economics & DIW Berlin | http://ideas.repec.org/e/pba1.html
An Introduction to Stata Programming | http://www.stata-press.com/books/isp.html
An Introduction to Modern Econometrics Using Stata | http://www.stata-press.com/books/imeus.html
*
* For searches and help try:
* http://www.stata.com/help.cgi?search
* http://www.stata.com/support/statalist/faq
* http://www.ats.ucla.edu/stat/stata/