Statalist


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

st: RE: RE: RE: Curious missing scalar after regress postestimation


From   "Martin Weiss" <[email protected]>
To   <[email protected]>
Subject   st: RE: RE: RE: Curious missing scalar after regress postestimation
Date   Tue, 14 Oct 2008 11:28:07 +0200

I have no idea why they might be missing sometimes, but not always. What I
would say is that this is not the most convenient method to store these
results. For one, -simulate- can do much of the work involved in storing. If
you insist on more control over this process, try the -postfile- suit of
commands (http://www.stata-journal.com/article.html?article=pr0036)



HTH
Martin


-----Original Message-----
From: [email protected]
[mailto:[email protected]] On Behalf Of Patrick P.
Phillips
Sent: Tuesday, October 14, 2008 11:09 AM
To: [email protected]
Subject: st: RE: RE: Curious missing scalar after regress postestimation

Thanks, Martin, for your reply. It usually works fine for me (it does so in
around 1800 of the 2000 simulations) which is why it is so infuriating.

The difficulty is that the scalar appears non-missing when I type 'scalar
list all', but when I try to use (in a calculation, post results or just
display) it appears to be missing!

Any other thoughts?

Many thanks in advance,

Patrick

PS Martin, originally it was scalar var_alpha = _se[alpha]^2, but I
simplified it for the post. You are correct that that could lead to problems
later on!
______________________________

Patrick Phillips
Statistician
MRC Clinical Trials Unit
222 Euston Road
London NW1 2DA

________________________________________
From: [email protected]
[[email protected]] On Behalf Of Martin Weiss
[[email protected]]
Sent: 14 October 2008 09:59
To: [email protected]
Subject: st: RE: Curious missing scalar after regress postestimation

Works for me when I try it with another example.

*********
sysuse census, clear

tabulate region, gen(region)
regress death medage region2-region4 [aw=pop], noc vce(cluster  state)
scalar var_medage = _se[medage]
di var_medage
scalar est_medage = _coef[medage]
di est_medage
*********

Sure you do not do anything in between storing and -display-ing that erases
your -scalar-s? Why not use packages like -ssc d parmest- or Stata`s -
estimates store- for this purpose?

BTW, probably dangerous to call the standard error of the OLS estimator
"var_...". Could lead to misinterpretations down the road...


HTH
Martin


-----Original Message-----
From: [email protected]
[mailto:[email protected]] On Behalf Of Patrick P.
Phillips
Sent: Tuesday, October 14, 2008 10:44 AM
To: [email protected]
Subject: st: Curious missing scalar after regress postestimation

I am running some simulations including a regress command and have come
across some curiosities with scalars.

I run the following commands:

    regress beta alpha [aweight=prec], nocons vce(cluster trial)

    scalar var_alpha = _se[alpha]
    scalar est_alpha = _coef[alpha]
    scalar r_sqrd = e(r2)

When I type scalar list, I get the following:

. scalar list
    r_sqrd =  .09759686
 est_alpha =  .42516408
 var_alpha =  .48875057

But, when I try to display the contents of scalar var_alpha, it appears to
only contain '.':

. disp var_alpha
.

Any thoughts on why this is? It's driving me mad!

Many thanks for your help,

Patrick

______________________________

Patrick Phillips
Statistician
MRC Clinical Trials Unit
222 Euston Road
London NW1 2DA



Due to a severe system failure that occurred early Monday 22nd September
2008 we have been unable to recover externally received e-mails due to
having to perform a system restore.

Please could you resend any e-mails sent between Monday 3:00am and Wednesday
12:00 noon BST (GMT +1 hour)

We regret any inconvenience this may have caused.

MRC Euston Campus ICT Service Desk
****************************************************************************
*****
This communication is confidential and may contain privileged information
intended solely for the named recipient(s). It may not be used or disclosed
except for the purpose for which it has been sent. If you are not the
intended recipient, you must not copy, distribute, take any action or
reliance on it. If you have received this communication in error, do not
open any attachments but please notify the MRC Euston Campus ICT Service
Desk by e-mailing [email protected] quoting the sender details, and then
delete this message along with any attached files. E-mail messages are not
secure and attachments could contain software viruses which may damage your
computer system. Whilst every reasonable precaution has been taken to
minimise this risk, The MRC cannot accept any liability for any damage
sustained as a result of these factors. You are advised to carry out your
own virus checks before opening any attachments. Unless expressly stated,
opinions in this message are those of the!
  e-mail author and not of the Medical Research Council (MRC).
****************************************************************************
*****

*
*   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/


Due to a severe system failure that occurred early Monday 22nd September
2008 we have been unable to recover externally received e-mails due to
having to perform a system restore.

Please could you resend any e-mails sent between Monday 3:00am and Wednesday
12:00 noon BST (GMT +1 hour)

We regret any inconvenience this may have caused.

MRC Euston Campus ICT Service Desk
****************************************************************************
*****
This communication is confidential and may contain privileged information
intended solely for the named recipient(s). It may not be used or disclosed
except for the purpose for which it has been sent. If you are not the
intended recipient, you must not copy, distribute, take any action or
reliance on it. If you have received this communication in error, do not
open any attachments but please notify the MRC Euston Campus ICT Service
Desk by e-mailing [email protected] quoting the sender details, and then
delete this message along with any attached files. E-mail messages are not
secure and attachments could contain software viruses which may damage your
computer system. Whilst every reasonable precaution has been taken to
minimise this risk, The MRC cannot accept any liability for any damage
sustained as a result of these factors. You are advised to carry out your
own virus checks before opening any attachments. Unless expressly stated,
opinions in this message are those of the!
  e-mail author and not of the Medical Research Council (MRC).
****************************************************************************
*****

*
*   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/



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