Statalist


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

Re: st: AW: Return results only from observations used in estimated model


From   John Antonakis <john.antonakis@unil.ch>
To   statalist@hsphsun2.harvard.edu
Subject   Re: st: AW: Return results only from observations used in estimated model
Date   Sun, 04 Oct 2009 21:27:31 +0200

Dear Martin and Richard:

Great!

-if e(sample)-

......does the trick!

By table, I wanted to table the frequencies of the categorical predictors, i.e.,

table y x z if e(sample), row col sc

Now I get the same number of observations from the table as I did in the logistic.

Thanks much.
John.

____________________________________________________

Prof. John Antonakis
Associate Dean Faculty of Business and Economics
University of Lausanne
Internef #618
CH-1015 Lausanne-Dorigny
Switzerland

Tel ++41 (0)21 692-3438
Fax ++41 (0)21 692-3305

Faculty page:
http://www.hec.unil.ch/people/jantonakis&cl=en

Personal page:
http://www.hec.unil.ch/jantonakis
____________________________________________________



On 04.10.2009 21:21, Martin Weiss wrote:
> <>
>
> Just condition on -e(sample)-. I am not quite sure what "table the results"
> is supposed to mean, though.
>
>
> *************
>
> vers 10.1
>
> clear*
> set obs 150
>
> gen x1=26+int(27*runiform())
> gen x2=runiform()<.48
>
> gen byte draw = /*
>  */ runiform() < /*
>  */ invlogit(1+.02*x1+.3*x2)
> > logistic draw x*
>
> tempvar tem
> gen `tem'=runiform()
> sort `tem'
>
> drop in 121/150
>
> logistic draw x*
> > table draw if e(sample), /*
> */ c(freq mean x1 mean x2)
> *************
>
>
>
> HTH
> Martin
>
> -----Ursprüngliche Nachricht-----
> Von: owner-statalist@hsphsun2.harvard.edu
> [mailto:owner-statalist@hsphsun2.harvard.edu] Im Auftrag von John Antonakis
> Gesendet: Sonntag, 4. Oktober 2009 21:17
> An: statalist@hsphsun2.harvard.edu
> Betreff: st: Return results only from observations used in estimated model
>
> Hi:
>
> Suppose I run a model using logistic on a data set with 150 observations:
>
> logistic y x z q r
>
> Now, suppose that because of listwise, the number of observations in the
> logistic model are 120.
>
> How would I table the results (using say only variable x and z) based
> ONLY on the data from the logistic model (i.e., the listwise sample) and
> not the whole sample ?
>
> Thanks in advance,
> John.
>

*
*   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–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index