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

From |
Nick Winter <nwinter@virginia.edu> |

To |
statalist@hsphsun2.harvard.edu |

Subject |
Re: st: create predicted values manually using matrices |

Date |
Mon, 23 Nov 2009 13:45:28 -0500 |

note that -predict- will do this even more directly. - Nick Joshua A. Shindell wrote:

Hello, I would like to create predicted values by multiplying my vector of estimated coefficients my the matrix of data used in the sample. I use the following code to extract my vector of coefficients after the regression: reg depvar indepvar1 indepvar2 matrix coeffs=e(b) matrix list coeffs matrix coeffs = coeffs' matrix list coeffsI have tried using the following code to extract my data values:local varnames : rownames(coeffs) local k = rowsof(coeffs) matrix values = J(`k',1,1) Where I am looking for some help is with filling the matrix named values with the values of each variable for each observation so I can use the values and the estimated coefficients to generate a predicted value. Any help is be greatly appreciated. Josh Shindell * * 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/

-- -------------------------------------------------------------- Nicholas Winter 434.924.6994 t Assistant Professor 434.924.3359 f Department of Politics nwinter@virginia.edu e University of Virginia faculty.virginia.edu/nwinter w PO Box 400787, 100 Cabell Hall Charlottesville, VA 22904 * * 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: create predicted values manually using matrices***From:*"Joshua A. Shindell" <jshindell@boegroup.com>

- Prev by Date:
**st: create predicted values manually using matrices** - Next by Date:
**st: data transfer** - Previous by thread:
**st: create predicted values manually using matrices** - Next by thread:
**st: RE: create predicted values manually using matrices** - Index(es):

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