>Hi S-Plus users,
>I learnig how to use S-plus. I am running a simple linear regression model (
>yt = contant + Coef * One independent variable + errors).
>I want to test whether Coef =1 using Monte carlo simulation. I find out how
>to use Bootstraping but couldn't find how to do it using Monte Carlo with
>SPlus.
>Does any one knows to do this?
>Thanks a million !
>Sam
Are you willing to assume that the residuals from the line y = x + constant
are independent and identically distributed (and independent of the x's)?
If so, then a permutation test would be appropriate, permuting
the residuals from that line (using any constant).
The resample library supports permutation tests.
It would handle the test Coef = 0. To convert your problem into
that framework, you can define
yx <- y - x
and then regress yx against x. This would test the hypothesis that yx
and x are independent.
Download S+Resample from www.insightful.com/downloads/libraries
If you're not willing to make that iid assumption, then there may be a
bootstrap test that would be approximately correct. The appropriate
way to bootstrap would depend on what you are willing to assume.
Tim Hesterberg
========================================================
| Tim Hesterberg Senior Research Scientist |
| timh@insightful.com Insightful Corp. |
| (206)802-2319 1700 Westlake Ave. N, Suite 500 |
| (206)283-8691 (fax) Seattle, WA 98109-3044, U.S.A. |
| www.insightful.com/Hesterberg |
========================================================
Advanced Programming in S-PLUS: San Antonio TX, March 26-27, 2008.
Bootstrap Methods and Permutation Tests: San Antonio, March 28, 2008.
|