Dear all,
I would like to calculate the pseudo-R2 for my multinomial logistic regression in multiple imputed data.
This is my code for imputing data and running the regression(s):
mi set mlong
mi register regular BROWNISH_MULTI GREENISH_MULTI GREEN_MULTI
mi register imputed BERD_AUTO CAR_SALES Log_PATENT_STOCK GREEN_GOV_RD REN_EN_PUB_RD FOSS_FUEL_PUB_RD BEV_SALES EPS GDP_PC
mi impute mvn BERD_AUTO CAR_SALES Log_PATENT_STOCK GREEN_GOV_RD REN_EN_PUB_RD FOSS_FUEL_PUB_RD BEV_SALES EPS GDP_PC = BROWNISH_MULTI, add(20)
mi estimate: mlogit BROWNISH_MULTI l(1).(BERD_AUTO CAR_SALES Log_PATENT_STOCK GREEN_GOV_RD REN_EN_PUB_RD FOSS_FUEL_PUB_RD BEV_SALES EPS GDP_PC), base(0)
I have read in a Statalist post that a possible solution to get the pseudo R2 after mi estimate is the following:
local rhs "armg2 armg3 tbsaburn20 tbsaburn21" noi mi estimate, or saving(miest, replace): logistic hodc `rhs', vce(cluster site) qui mi query local M=r(M) scalar r2=0 scalar cstat=0 qui mi xeq 1/`M': logistic hodc `rhs'; scalar r2=r2+e(r2_p); lroc, nog; scalar cstat=cstat+r(area) scalar r2=r2/`M' scalar cstat=cstat/`M' noi di "Pseudo R=squared over imputed data = " r2 noi di "C statistic over imputed data = " cstat I don't understand exactly how to adapt this code to my needs (e.g. where to plug my variables).
Could you provide me any help, please? Many thanks in advance
Anna
Related Posts with how to calculate pseudo-R2 using imputed data in a multinomial logistic regression
Second axis marginsplotDear Stata Users, I am computing a multinomial logit and its predicted probabilities - command marg…
Second axis marginsplotDear Stata Users, I am computing a multinomial logit and its predicted probabilities - command marg…
Identify the variable based on a given locationDear Stata users, I have the following data sample where fam_id represents the family, hh_count repr…
Multilevel mixed-effects linear regression error: BLUP calculation failed; estimation data have changedHello, I'm trying to perform some postestimation analysis after fitting a multilevel mixed-effects …
I have in-sample predictions after lasso regressions but can not make them out-of-sampleDear All I had an old post that perhaps was not clear. As is advised by some of you, I decided to c…
Subscribe to:
Post Comments (Atom)
0 Response to how to calculate pseudo-R2 using imputed data in a multinomial logistic regression
Post a Comment