Dear Statalist,
I very much hope you can help me with this Stata problem.
I have a list of independent variables that I would like to test in a logistic regression and then compute a partial pseudo R2 for each variable to rank variables by their relative importance. There appears to be no prepackaged way to do this so I have resorted to manual calculations.
The formula for the partial pseudo R2 requires the Wald test chi2 statistic (LR would be better but too cumbersome, and I have a large sample size anyway). I would like to get this automatically, probably from the matrix generated from the -test- command, and then compute the partial R2 for each variable.
my plan:
logit y x1 x2 x3 //run the regression
test x1 x2 x3, mtest // calculate wald statistics
matrix myresults = r(mtest)
... and here is when I would like to pull the results from the matrix 'myresults' , calculate the partial pseudo R2 using my formula, ideally store the results somewhere (in a new matrix?), and automatically rank by partial pseudo R2.
The process needs to be automated because I will be doing it over many different subsets of the data and with different lists of independent variables that depend on the subset.
Any help from the community would be greatly appreciated and will probably turn me into a much better Stata user!
Pavel
I very much hope you can help me with this Stata problem.
I have a list of independent variables that I would like to test in a logistic regression and then compute a partial pseudo R2 for each variable to rank variables by their relative importance. There appears to be no prepackaged way to do this so I have resorted to manual calculations.
The formula for the partial pseudo R2 requires the Wald test chi2 statistic (LR would be better but too cumbersome, and I have a large sample size anyway). I would like to get this automatically, probably from the matrix generated from the -test- command, and then compute the partial R2 for each variable.
my plan:
logit y x1 x2 x3 //run the regression
test x1 x2 x3, mtest // calculate wald statistics
matrix myresults = r(mtest)
... and here is when I would like to pull the results from the matrix 'myresults' , calculate the partial pseudo R2 using my formula, ideally store the results somewhere (in a new matrix?), and automatically rank by partial pseudo R2.
The process needs to be automated because I will be doing it over many different subsets of the data and with different lists of independent variables that depend on the subset.
Any help from the community would be greatly appreciated and will probably turn me into a much better Stata user!
Pavel
Comment