Quantcast
Channel: Statalist
Viewing all articles
Browse latest Browse all 72771

Using deviation coding (devcon) with linear regression

$
0
0
Has anyone used the devcon command with linear regression? I've been working with this and could use some advice on whether I've run this correctly.

I have two variables - one a continuous variable (B12) and one a categorical variable. (I'm looking at student enrollment (B12) in about 600 higher education programs across 17 fields of study.) The continuous variable (B12) is the number of students enrolled in each program and the categorical variable (i.NEWTaxonomy) includes the 17 different fields of study. For each field of study within NEWTaxonomy, I generated a new variable, i.e., NEWTaxonomy=1 becomes tax1, NEWTaxonomy=2 becomes tax2, NEWTaxonomy=3 becomes tax3, etc.

I then ran a linear regression: regress B12 i.NEWTaxonomy, vce(robust)

Followed by: regress B12 tax2 tax3 tax4 tax5 tax6 tax7 tax8 tax9 tax10 tax11 tax12 tax13 tax14 tax15 tax16 tax17, vce(robust)

And then: devcon, groups(tax1 tax2 tax3 tax4 tax5 tax6 tax7 tax8 tax9 tax10 tax11 tax12 tax13 tax14 tax15 tax16 tax17)

In the final step, what I'm assuming I'm doing (and what I want to be doing!) is looking at deviations from the grand mean.

The coefficients, robust standard errors, F-tests and R-squared in the results from the first two steps are all identical and p-values in the third step seem logical, but I could use some reassurance that I've run this correctly!

Thanks in advance for any advice.

Nathan Bell

Viewing all articles
Browse latest Browse all 72771

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>