Statalist The Stata Listserver


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

st: RE: question from a new user


From   "Salvati, Jean" <[email protected]>
To   <[email protected]>
Subject   st: RE: question from a new user
Date   Fri, 10 Feb 2006 11:00:45 -0500

Here is an example:

sysuse auto
regress mpg weight
ereturn list
local nobs = e(N)
local r2 = e(r2)
local lm = `nobs'*`r2'
di "lm: `lm'"

Jean Salvati

> -----Original Message-----
> From: [email protected] 
> [mailto:[email protected]] On Behalf Of 
> Rudy Fichtenbaum
> Sent: Friday, February 10, 2006 10:20 AM
> To: [email protected]
> Subject: st: question from a new user
> 
> I am a relatively new user of Stata having used SAS for many 
> years. I know that when you run a regression in Stata it 
> produces a whole series of results that are stored under e( ) 
> e.g. R squared, N, RSS etc. The problem I am having is I 
> can't figure out how to access those stored results. I want 
> to use the stored results to calculate an LM statistic. 
> I can do this manually using the results and the display 
> command but there must be a way of programing Stata to do this task.
> 
> Here is what I want to do. I run a restricted regression and 
> then obtain the residuals. Next I regress the residuals on 
> the independent variables from the unrestricted model. N 
> times the R square from this equation is an LM statistic.
> 
> Rudy
> 

*
*   For searches and help try:
*   http://www.stata.com/support/faqs/res/findit.html
*   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