[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

RE: st: Postestimation using different data

From   "West, Nancy (DOH)" <[email protected]>
To   <[email protected]>
Subject   RE: st: Postestimation using different data
Date   Thu, 27 Dec 2007 09:46:12 -0800


Thank you so much for your quick reply.  I will give it a try!


-----Original Message-----
From: [email protected]
[mailto:[email protected]] On Behalf Of Yulia
Marchenko, StataCorp
Sent: Thursday, December 27, 2007 9:38
To: [email protected]
Subject: Re: st: Postestimation using different data

Nancy West <[email protected]> wants to validate a model fitted by
-logit- command:

> Using version 9, I've run a logit model and now want to validate it.  
> I am using another dataset to do so.

So Nancy has two datasets -- one used for estimation and another she
wants to use for validation.  Nancy can validate the model by using
option -all- with -estat classification-.

        . use <first_data_set>
        . logit (or logistic) <outcome> ...
        . use <second_data_set>
        . estat classification, all

If the validation dataset has different variable names than the
estimation dataset, Nancy would need to rename the variables first.

Also, Nancy is not able to reproduce an example from Stata 9 of -estat

> I've followed the directions according to the manual ([R] K-Q, pg. 
> 88-89). I did "matrix input..."  and "matrix colnames..."  I've run 
> "lroc..." and "lsens..." They work but "estat gof"
> and "estat clas" do not.  I typed the "estat gof" command exactly as 
> in the manual but it gives me the message "varlist not allowed".  
> "Estat clas" also gives me the same error message and this is the test
I really want.

This example should not have been in the documentation; it was removed
from the Stata 10 documentation.  If Nancy wants a classification table,
she will have to do it by hand:

        . matrix score linear_prediction = <matrixname>

        . gen predicted_p = invlogit(linear_prediction)

        . gen classification = (predicted_p >= #)

        . tabulate classification <outcome>

where Nancy substitutes for <matrixname> the matrix containing the
coefficient estimates, for # the cutoff, such as 0.5, and for <outcome>
the dependent variable name.

[email protected]
*   For searches and help try:

*   For searches and help try:

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