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

From |
"Martin Weiss" <martin.weiss1@gmx.de> |

To |
<statalist@hsphsun2.harvard.edu> |

Subject |
AW: st: R: Goodness of fit measure akin to R-squared for 0-constant or noconstant |

Date |
Fri, 24 Apr 2009 12:25:16 +0200 |

<> I do think that such a -relatively- easy formula could be calculated in the old -matrix- commands (see -help matrix-). All it takes would be transposing the (Y-XBhat) matrix, subtraction and multiplication. The -help matrix- for Stata 10 contains an example for the OLS estimator calculation, that reads as *** matrix beta = invsym(X'*X)*X'*y *** so that is pretty much what you need... HTH Martin -----Ursprüngliche Nachricht----- Von: owner-statalist@hsphsun2.harvard.edu [mailto:owner-statalist@hsphsun2.harvard.edu] Im Auftrag von Bas de Goei Gesendet: Freitag, 24. April 2009 12:20 An: statalist@hsphsun2.harvard.edu Betreff: Re: st: R: Goodness of fit measure akin to R-squared for 0-constant or noconstant Ah...yes you're right. Y would be a (n x 1) vector...hmm, I only have Stata 8, any idea how y'd do such a calc without mata? On Fri, Apr 24, 2009 at 11:13 AM, Martin Weiss <martin.weiss1@gmx.de> wrote: > <> > > This formula screams "MATA"! > > See http://www.stata.com/meeting/fnasug08/baum_StataMata.beamer.FNASUG08.pdf > > > > HTH > Martin > > > -----Ursprüngliche Nachricht----- > Von: owner-statalist@hsphsun2.harvard.edu > [mailto:owner-statalist@hsphsun2.harvard.edu] Im Auftrag von Bas de Goei > Gesendet: Freitag, 24. April 2009 12:05 > An: statalist@hsphsun2.harvard.edu > Betreff: Re: st: R: Goodness of fit measure akin to R-squared for 0-constant > or noconstant > > Hmm, my searches online have provided me with some insightful work by > Kvalseth (1985). Apparently, he has an alternative R-squared which > should work across models (including no constant or 0 constant > models). > > It's specified by 1 - [(Y-XBhat) ' (Y-XBhat) / Y'Y - Ymean squared] > > I could put it in myself, or is there already a user-written command > for this uniform R-squared? > > > > On Fri, Apr 24, 2009 at 10:50 AM, Carlo Lazzaro > <carlo.lazzaro@tiscalinet.it> wrote: >> Dear Bas, >> I don't know whether or not your models (with and without constant) can be >> fruitfully compared via AIC or BIC criteria. >> >> However, my knee-jerk advice is typing: >> >> - search postestimation timeseries - >> >> from within Stata. >> >> Sorry I cannot be more helpful. >> >> Kind Regards, >> Carlo >> -----Messaggio originale----- >> Da: owner-statalist@hsphsun2.harvard.edu >> [mailto:owner-statalist@hsphsun2.harvard.edu] Per conto di Bas de Goei >> Inviato: venerdì 24 aprile 2009 10.54 >> A: statalist@hsphsun2.harvard.edu >> Oggetto: st: Goodness of fit measure akin to R-squared for 0-constant or >> noconstant >> >> Dear all, >> >> I am currently creating forecasts for jewellery demand in India by >> regressing GDP on demand for jewellery. >> >> Let me first give the required background: >> I have data going back to 1980. In a regression based on GDP over >> time, you obviously run into the problem of serial autocorrelation, >> though this is neccesarily a problem for a forecast, my boss wants >> "only regressions that pass Durbin Watson test". >> >> I really have two problems: >> >> The first is that the normal OLS regression result indicated a >> positive intercept. However, economically this would mean that even >> when there is no growth in GDP, there would still be growth in the >> demand for jewellery. Of course, there was the problem that the model >> did not pass the Durbin Watson test. Fitting the model with the GLS >> approach (the prais command in Stata), did improve the model, but it >> kept (as expected) the intercept positive. >> >> I decided to inspect the data more closely, and to drop two outliers >> from the data. The intercept under the Prais command is now still >> positive, but it has become insignificant. I decided that there is >> justification to re-run the regression with a 0 intercept. However, >> this balloons the F statistic and the R-squared. I now understand why >> that is, given the mathematics behind the R squared calculation. >> >> My question is, how would you calculate in Stata a "correct" or >> "alternative" R-squared, or a goodness of fit measure, which you can >> use to compare it to the model with a constant?? >> >> Thanks!! >> >> Bastiaan >> * >> * 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/ * * 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/

**References**:**st: Goodness of fit measure akin to R-squared for 0-constant or noconstant***From:*Bas de Goei <bas.degoei@gmail.com>

**st: R: Goodness of fit measure akin to R-squared for 0-constant or noconstant***From:*"Carlo Lazzaro" <carlo.lazzaro@tiscalinet.it>

**Re: st: R: Goodness of fit measure akin to R-squared for 0-constant or noconstant***From:*Bas de Goei <bas.degoei@gmail.com>

**Re: st: R: Goodness of fit measure akin to R-squared for 0-constant or noconstant***From:*Bas de Goei <bas.degoei@gmail.com>

- Prev by Date:
**Re: st: R: Goodness of fit measure akin to R-squared for 0-constant or noconstant** - Next by Date:
**Re: st: R: Goodness of fit measure akin to R-squared for 0-constant or noconstant** - Previous by thread:
**Re: st: R: Goodness of fit measure akin to R-squared for 0-constant or noconstant** - Next by thread:
**Re: st: R: Goodness of fit measure akin to R-squared for 0-constant or noconstant** - Index(es):

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