Notice: On March 31, it was **announced** that Statalist is moving from an email list to a **forum**. The old list will shut down on April 23, and its replacement, **statalist.org** is already up and running.

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

From |
"Patrick Miller" <P-Miller@gmx.de> |

To |
statalist@hsphsun2.harvard.edu |

Subject |
st: mvrs: out-of-sample prediction/definition of the splines |

Date |
Wed, 05 Dec 2012 11:57:48 +0100 |

Hello, I want to use a mvrs model for out-of-sample prediction but unfortunately I have some trouble with the option "all". I have devided my data in training- and test-sample by using a binary variable train. To build a model (without option "all") I use: (1) mvrs regress y x1 x2 x3 if train==1, degree(3) Let x1 be continuous and a spline transformation with two knots is done. Hence new variables x1_0, x1_1 and x1_2 are generated. If I use the samle model but with option "all": (2) mvrs regress y x1 x2 x2 if train==1, all degree(3) x1_0, x1_1 and x1_2 are generate as well, but the stored values for the training-sample differ from the ones generated by model (1). My interpretation is that the transformation for the test-sample is not only done by the information provided by the training-sample. In fact for the transformation training- and test-data are used. In my opinion this is not a correct way of out-of-sample testing. Is there any way to generate x1_0, x1_1 and x1_2 for the test-sample only based on the information of the training-sample? Thanks a lot! Patrick Miller * * 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/

**Follow-Ups**:**Re: st: mvrs: out-of-sample prediction/definition of the splines***From:*Nick Cox <njcoxstata@gmail.com>

- Prev by Date:
**st: Stacked bar graph.. in white and black ...** - Next by Date:
**Re: st: reading value labels -- second and third largest values** - Previous by thread:
**st: Stacked bar graph.. in white and black ...** - Next by thread:
**Re: st: mvrs: out-of-sample prediction/definition of the splines** - Index(es):