s-news
[Top] [All Lists]

Re: Monte carlo simulation

To: "Saadi, Samir" <Saadi@telfer.uottawa.ca>
Subject: Re: Monte carlo simulation
From: Tim Hesterberg <timh@insightful.com>
Date: Mon, 21 Jan 2008 13:24:46 -0800
Cc: "S-News" <s-news@lists.biostat.wustl.edu>
In-reply-to: <EBEF03D341A7544EA1481BB1B64FA6760122CF37@SoM-Exchange.management.uottawa.ca> (Saadi@telfer.uottawa.ca)
References: <1366519230.20080121111743@lcpc.fr> <4794A834.8090902@mango-solutions.com> <EBEF03D341A7544EA1481BB1B64FA6760122CF37@SoM-Exchange.management.uottawa.ca>
>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.

<Prev in Thread] Current Thread [Next in Thread>