Hi There,
I am using data which employs a multi-stage probability sample and provides both sample and replicate weights. I would like to obtain standardized regression coefficients from the regression model as I will be comparing coefficients across outcomes/instruments. I have read several threads indicating that the "beta" option will not work with "svy" and the "listcoef" post estimation command is unreliable. I found the following workaround (https://www.statalist.org/forums/for...-weighted-data). However, my independent variable (X2POVTY200) is a dichotomous variable so I only wish to obtain standardized coefficients in terms of Y (X1MATH). Any help on how to edit the syntax below so that the scale of X (X2POVTY200) is preserved would be greatly appreciated.
Thanks!
-Jenn
----------------------------------
*/set sampling parameters*/
svyset [pweight= W7C17P_20], jkrweight(W7C17P_21-W7C17P_240) vce(jack) mse
/*get coefficients*/
svy jackknife: regress X1MATH X2POVTY200
matrix b = e(b)
/* get SDs of y and predictors */
svy: mean X1MATH
estat sd
matrix sy = r(sd)
svy: mean X2POVTY200
estat sd
matrix sx = r(sd)
/*compute standardized coefficients */
mata:
sy = st_matrix("sy")
sx = st_matrix("sx")'
b = st_matrix("b")
bx = b[1 ,1..(cols(b)-1)]'
st_matrix("betas",(sx:/sy):*bx)
end
matrix rownames betas = X2POVTY200
matrix list betas
I am using data which employs a multi-stage probability sample and provides both sample and replicate weights. I would like to obtain standardized regression coefficients from the regression model as I will be comparing coefficients across outcomes/instruments. I have read several threads indicating that the "beta" option will not work with "svy" and the "listcoef" post estimation command is unreliable. I found the following workaround (https://www.statalist.org/forums/for...-weighted-data). However, my independent variable (X2POVTY200) is a dichotomous variable so I only wish to obtain standardized coefficients in terms of Y (X1MATH). Any help on how to edit the syntax below so that the scale of X (X2POVTY200) is preserved would be greatly appreciated.
Thanks!
-Jenn
----------------------------------
*/set sampling parameters*/
svyset [pweight= W7C17P_20], jkrweight(W7C17P_21-W7C17P_240) vce(jack) mse
/*get coefficients*/
svy jackknife: regress X1MATH X2POVTY200
matrix b = e(b)
/* get SDs of y and predictors */
svy: mean X1MATH
estat sd
matrix sy = r(sd)
svy: mean X2POVTY200
estat sd
matrix sx = r(sd)
/*compute standardized coefficients */
mata:
sy = st_matrix("sy")
sx = st_matrix("sx")'
b = st_matrix("b")
bx = b[1 ,1..(cols(b)-1)]'
st_matrix("betas",(sx:/sy):*bx)
end
matrix rownames betas = X2POVTY200
matrix list betas
Comment