2 years ago

#57791

test-img

Clara Schmitt

Effect coding with three categories

I need to do effect coding in Stata for a class project. We need to replicate the empirical analysis of the following [paper][1]. The main gist is that there are three different country variables which need to be effect coded so they can all three be used in an OLS regression model. We tried to code the country variables like this:

gen denmark=. 
replace denmark = 1 if cntry == "DK"
replace denmark = 0 if cntry == "NO"
replace denmark = -1 if cntry == "AT"

and

gen norway=.
replace norway = 1 if cntry == "NO"
replace norway = 0 if cntry == "DK"
replace norway = -1 if cntry == "AT"

However, if we then run the regression, we only get two coefficients in the regression model (which should be correct since effect coding always runs with k-1 groups), but the authors got three different coefficients. If we then try to code with another variable, say:

gen austria=.
replace austria = 1 if cntry == "AT"
replace austria = 0 if cntry == "DK"
replace austria = -1 if cntry == "NO"

Stata always omits one of the used variables (because of linearity, which makes sense) and we only get two coefficients.

Does anyone know how we can code the country variables in a way that we get three different coefficients in the OLS regression model (i.e. like the authors)?

Link to the paper: https://www.tandfonline.com/doi/full/10.1080/17457280902799014

linear-regression

stata

replication

effect

0 Answers

Your Answer

Accepted video resources