Statalist The Stata Listserver

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

RE: st: Bell Curve of Predicted Values

From   "Scott Merryman" <[email protected]>
To   <[email protected]>
Subject   RE: st: Bell Curve of Predicted Values
Date   Mon, 17 Apr 2006 09:48:04 -0500

Perhaps something like this:

sysuse auto
estsimp regress price mpg fore, sims(100000)
setx mpg 12 fore 1
simqi, ev genev(expected_price)
histogram expected, norm

This uses programs from Michael Tomz, Jason Wittenberg, and Gary King's

> -----Original Message-----
> From: [email protected] [mailto:owner-
> [email protected]] On Behalf Of Randall
> Sent: Monday, April 17, 2006 9:16 AM
> To: [email protected]
> Subject: Re: st: Bell Curve of Predicted Values
> Maarten, thanks.  This seems very close to what I
> would like to do.  I had been calculating my predicted
> values using matrix language, just because I had
> particular x-values I was interested in obtaining a
> prediction for.  Using your example, I did something
> like this:
> reg price mpg foreign
> matrix yhat=_b[_cons] + _b[mpg]*12 + _b[foreign]*1
> matrix list yhat
> So in essence, I wanted a prediction for mpg=12,
> foreign=1.
> So my question is this:  is there a way of generating
> a distribution based on particular criteria (i.e.
> mpg=12, foreign=1)?
> Thanks again,
> Randall

*   For searches and help try:

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