I have squared root the dependent variable to deal with the non-normally distributed residuals. The dependent variable is measured in centimetres, so the values for the dependent variable are greater than 0. All the independent variables are dummy variables. My sample size is 1000. After running the linear regression and estimating the margins, I transformed the margins back to the original values. I have used this command:
generate generate sqrtindep1=sqrt(indep1)
repress dependent i.sqrtindep1 i.indep2 i.indep3 i.indep4
margins sqrtindep1, expression(predict(xb)^2)"
I have read also instead of transforming the dependent variable I can use glm with link power and then estimate margins. However, the estimated margins from glm are different from the liner regression. Any advice why the margins are different and which model is more appropriate?
glm dependent i.indep1 i.indep2 i.indep3 i.indep4 , link(power 0.5)
margins indep1
Related Posts with Linear regression
Dependent variable comes in months, how to build model?I am studying the determinants of unemployment spells. My dependent variable is unemployment spell (…
Analytical weight in a count model with an exogenous treatmentHello, I have a quick question regarding weights in 'teffects'. Could you please point me towards t…
How do i compute the geometric increase rate of a variable in a panel dataset?Hello everyone, I'm new to Stata and this forum. If I do something wrong, please tell me. I would li…
nested loopsI divided a variable in quintiles and I want to summarize a list of variables for each quintiles. I …
All Observations are Duplicates - Panel Data r(451) Repeated Time Variables within panelHello, Using Stata 12, I have a panel dataset from 2010 to 2019 with 23 variables and 1484908 obser…
Subscribe to:
Post Comments (Atom)
0 Response to Linear regression
Post a Comment