Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
st: AW: AW: testing a model
From
"Martin Weiss" <[email protected]>
To
<[email protected]>
Subject
st: AW: AW: testing a model
Date
Mon, 1 Mar 2010 16:25:09 +0100
<>
And here is how you would obtain "yhats" and errors. Note I am giving
technical details, not, in any way, shape or form endorsing your approach:
*************
sysuse auto, clear
tempfile myfile
regress price mpg, vce(jackknife, /*
*/ saving(`myfile', replace))
merge 1:1 _n using `myfile', /*
*/ norep nogen
gen yhat=_b[_cons]+_b[mpg]*mpg
gen error=price-yhat
*************
HTH
Martin
-----Ursprüngliche Nachricht-----
Von: [email protected]
[mailto:[email protected]] Im Auftrag von Martin Weiss
Gesendet: Montag, 1. März 2010 14:45
An: [email protected]
Betreff: st: AW: testing a model
<>
Getting the coefficients is easy enough via a judicious choice for the vce:
*************
sysuse auto, clear
regress price mpg, vce(jackknife, saving(myfile, replace))
u myfile, clear
l
*************
HTH
Martin
-----Ursprüngliche Nachricht-----
Von: [email protected]
[mailto:[email protected]] Im Auftrag von luc paugam
Gesendet: Montag, 1. März 2010 14:23
An: [email protected]
Betreff: st: testing a model
Hello everyone,
I am a new user of stata, and I struggle with this particular issue:
I hope I will be clear enough.
I would like to test the accuracy of my model in the following manner:
Estimate my regression with (*N-1*) observations, and with the coefficients
obtained, predict the "*y_hat_i*" of the observation "*i*" I didn't use to
estimate the coefficients.
I would like to do that *N* times, in order to have *N* "*y_hat_i*" (*i=1,
... ,N*).
Than I could compare the "*y_hat_i*" with the real "*y*", and test the
accuracy of my model (mean errors, median error, standard deviation etc.)
I appreciate your time,
Luke
*
* 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/