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
fixed effects and constant estimatesDear All, Does anyone know the relationship among the following commands? I mean how can we adjust t…
Double selection lassoDear statalist, I have attempted a logit regression and now I need to attempt a double selection la…
Rename from last part of label that includes "."Hello! I'm trying to rename variables from the label, but this label includes dots (".") Example La…
Remove blank lines from string colvectorIf I have a string colvector in Mata, how can I create a new string colvector that removes rows with…
Count by groups 5 years after the current yearDear Statalist, I am wondering if you can help me to count the number of times a given attribute is …
Subscribe to:
Post Comments (Atom)
0 Response to how to calculate pseudo-R2 using imputed data in a multinomial logistic regression
Post a Comment