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]
RE: st: reading in 150 stored regression models from csv file, one at a time and using predict ... ?
From
Alexander Nervedi <[email protected]>
To
"[email protected]" <[email protected]>
Subject
RE: st: reading in 150 stored regression models from csv file, one at a time and using predict ... ?
Date
Sat, 23 Nov 2013 09:45:34 +0000
Thanks Sergiy. This is the default that i have, i was just wondering if one could do the generate through a matrix multiplication then it would be cool - but haven't figured that out yet.
----------------------------------------
> Date: Fri, 22 Nov 2013 17:56:28 -0500
> Subject: Re: st: reading in 150 stored regression models from csv file, one at a time and using predict ... ?
> From: [email protected]
> To: [email protected]
>
> Alex,
> use -insheet- to read the estimates back to Stata, once there save
> them to matrices, then load the original data, then do predictions
> with:
> generate yhat`i'=beta[1,`i']*x1+.....
>
> However it is probably easier if you do predictions on the spot (in
> the same loop which originally created the 205 estimates). Unless you
> already lost your outcome variable and can't go back.
>
> Best, Sergiy
>
>
> On Fri, Nov 22, 2013 at 1:46 PM, Alexander Nervedi
> <[email protected]> wrote:
>> Hi Stata-masters,
>>
>> I have transactions data on 205 different commodity groups, and have estimated simple OLS models for hedonic prices each of these groups - simple reg y x1 x2 x3 x4 x5, where y is prices and x1, ... x5 are attributes of the commodities. I have stored these models in coef.csv using parmby and outsheet. Now i would like to read in the regressions from each of the these 205 models, and try to figure out what the prices would have been across each of the 205 categories if the structural relationship looked like it does for commodity group `j' where `j' takes on values from 1 to 205.
>>
>> I need to read in the coefs and run predict for the entire sample one set of coefs a time - but how do i get that to happen since predict doesn't work unless an ols command has been run ...
>>
>> thanks,
>>
>> Alex
>> *
>> * For searches and help try:
>> * http://www.stata.com/help.cgi?search
>> * http://www.stata.com/support/faqs/resources/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/faqs/resources/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/faqs/resources/statalist-faq/
* http://www.ats.ucla.edu/stat/stata/