Statalist


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

st: RE: Re: RE: RE: R2 stats using statsby or parmby???


From   "Hugh Robinson" <[email protected]>
To   <[email protected]>
Subject   st: RE: Re: RE: RE: R2 stats using statsby or parmby???
Date   Sat, 27 Jun 2009 16:38:18 -0600

Thanks Martin - you've got me moving forward again.

You wouldn't happen to know how to get the model pseudo r-square
displayed would you?  In Roger's post below he suggests that parmby
calculates and stores it as r2_p, but I don't see it.



-----Original Message-----
From: [email protected]
[mailto:[email protected]] On Behalf Of Martin Weiss
Sent: Saturday, June 27, 2009 3:44 PM
To: [email protected]
Subject: st: Re: RE: RE: R2 stats using statsby or parmby???

<>

Not sure whether that blank after -flist-- hurt you, but you should use
line 
continuation  "///". Also note that -by- likes to be passed a dataset
sorted 
by its -varlist-, so append an "s" to make it "bysort"...

***
use http://www.ats.ucla.edu/stat/stata/dae/logit.dta, clear
global tflist ""
global modseq=0
foreach X in gre topnotch gpa {
global modseq=$modseq+1
tempfile tf$modseq
parmby "logit admit `X'", label  ///
command format(estimate min95 max95 ///
%8.2f p %8.1e) idn($modseq)  ///
saving(`tf$modseq',replace) ///
flist(tflist)
}
dsconcat $tflist
sort idnum parmseq
describe
bys idnum command:list parm ///
 label estimate min95 max95 p,noobs
***


HTH
Martin
_______________________
----- Original Message ----- 
From: "Hugh Robinson" <[email protected]>
To: <[email protected]>
Sent: Saturday, June 27, 2009 11:10 PM
Subject: st: RE: RE: R2 stats using statsby or parmby???


> Roger,
>
> I was intrigued by reading your response to this posting, I think the
> foreach and parmby commands could be very helpful for me in running a
> number of univariat logits and producing a single table containing
each
> variable name, its coefficient, p-value, and r-square value.
>
> Towards that goal I thought I would start with the UCLA sample logit
> data and try to modify the command list from the parmby help file to
> create something looks like what I'm after.
>
> When I run the following code the foreach loop only gets as far the
> first covariate "gre" then produces an error that reads "variable
tflist
> not found".
>
> Can you see what's wrong?
>
>
> Thanks
> HR
>
>
> use http://www.ats.ucla.edu/stat/stata/dae/logit.dta, clear
> global tflist ""
> global modseq=0
> foreach X in gre topnotch gpa {
> global modseq=$modseq+1
> tempfile tf$modseq
> parmby "logit admit `X'", label command format(estimate min95 max95
> %8.2f p %8.1e) idn($modseq) saving(`tf$modseq',replace)
> flist (tflist)
> }
> dsconcat $tflist
> sort idnum parmseq
> describe
> by idnum command:list parm label estimate min95 max95 p,noobs
>
>
>
>
> -----Original Message-----
> From: [email protected]
> [mailto:[email protected]] On Behalf Of Newson,
Roger
> B
> Sent: Friday, June 26, 2009 1:07 PM
> To: '[email protected]'
> Subject: st: RE: R2 stats using statsby or parmby???
>
> You do not specify what goodness-of-fit statistic you want, or which
> program you are using to do your logistic regression (O prefer -glm-,
> but many other people prefer -logit- or -logistic-). However, if the
> goodness-of-fit statistic is saved in e(), then either -statsby- or
> -parmby- can save it. In the case of -parmby-, you use the -escal()-
> option to save extra scalar results. As in
>
> parmby "glm y x, link(logit) family(bin) eform robust", eform
norestore
> by(group) escal(aic bic chi2 dispers_p)
>
> which should save -e(aic)-, -e(bic)-, -e(chi2)- and -e(dispers_p)- in
> scalar variables named -es_1-, -es_2-, -es_3-, and -es_4-,
respectively.
> You can give them more informative names using the -rename()- option.
> Similarly, the -logit- and -logistic- commands save the
pseudo-R-squared
> in -e(r2_p)-.
>
> I hope this helps.
>
> Best wishes
>
> Roger
>
>
> Roger B Newson BSc MSc DPhil
> Lecturer in Medical Statistics
> Respiratory Epidemiology and Public Health Group
> National Heart and Lung Institute
> Imperial College London
> Royal Brompton Campus
> Room 33, Emmanuel Kaye Building
> 1B Manresa Road
> London SW3 6LR
> UNITED KINGDOM
> Tel: +44 (0)20 7352 8121 ext 3381
> Fax: +44 (0)20 7351 8322
> Email: [email protected]
> Web page: http://www.imperial.ac.uk/nhli/r.newson/
> Departmental Web page:
>
http://www1.imperial.ac.uk/medicine/about/divisions/nhli/respiration/pop
> genetics/reph/
>
> Opinions expressed are those of the author, not of the institution.
>
> -----Original Message-----
> From: [email protected]
> [mailto:[email protected]] On Behalf Of Thomas M
> Holbrook
> Sent: 26 June 2009 18:09
> To: [email protected]
> Subject: st: R2 stats using statsby or parmby???
>
> I'm trying to find a way the generate goodness-of-fit stats for logit
> models run separately over subgroups of my my data (I'm running a vote
> model using individual-level data and I want to generate fit stats by
> day of the campaign).  I can get the slopes and standard errors using
> "statsby" or "parmby" but I don't set a way of generating the fit
stats.
> Any ideas???
>
> -Tom
>
> Thomas M. Holbrook
>
> Wilder Crane Professor of Government
> Department of Political Science
> University of Wisconsin-Milwaukee
> 3210 North Maryland Avenue
> Milwaukee, WI  53211
>
> www.uwm.edu/~holbroot
> www.election08data.blogspot.com
>
> 414-229-6468
> *
> *   For searches and help try:
> *   http://www.stata.com/help.cgi?search
> *   http://www.stata.com/support/statalist/faq
> *   http://www.ats.ucla.edu/stat/stata/
>
> *
> *   For searches and help try:
> *   http://www.stata.com/help.cgi?search
> *   http://www.stata.com/support/statalist/faq
> *   http://www.ats.ucla.edu/stat/stata/
>
> *
> *   For searches and help try:
> *   http://www.stata.com/help.cgi?search
> *   http://www.stata.com/support/statalist/faq
> *   http://www.ats.ucla.edu/stat/stata/
> 

*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/

*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/



© Copyright 1996–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index