# Marginal effect Tobit in Stata

#### carmen256

##### New Member
Hi everyone,

How can I calculate with the margins command the marginal effect of a variable for a Tobit model in Stata using for all variables their mean value ? So, in other words, how can I calculate the marginal effect at the mean of all variables?

Any help is much appreciated,

Thanks a lot!,

Best Carmen

#### RedOwl

##### New Member
Exracted, modified, and expanded to demonstrate margins after tobit from:
UCLA Institute for Digital Research and Education (idre)
http://www.ats.ucla.edu/stat/stata/dae/tobit.htm

*** Begin Stata Code ***
use http://www.ats.ucla.edu/stat/stata/dae/tobit, clear
tobit apt read math i.prog, ul(800)
predict predapt
corr apt predapt
di "r{c 178} between observed and preducted = " %6.4f r(rho)^2

margins, atmeans

margins, over(i.prog)
marginsplot, scheme(s1color)

marginsplot, scheme(s1color)

margins, at(math=(25(10)75))
marginsplot, scheme(s1color)
*** End Stata Code ***

#### RedOwl

##### New Member
If you are interested in calculating elasticities using margins after tobit, you can extend the Stata example in the post above. (Again, the example data and original tobit example are from UCLA's Institute for Digital Research and Education at http://www.ats.ucla.edu/stat/stata/dae/tobit.htm)

*** Begin Stata Code ***
use http://www.ats.ucla.edu/stat/stata/dae/tobit, clear

tobit apt read math i.prog, ul(800)

set cformat %7.4f

margins, eyex(math)