Re: [R] Monte Carlo Simulation

From: MacQueen, Don <macqueen1_at_llnl.gov>
Date: Fri, 15 Apr 2011 15:25:45 -0700


See below:

-- 
Don MacQueen

Lawrence Livermore National Laboratory
7000 East Ave., L-627
Livermore, CA 94550
925-423-1062





-----Original Message-----
From: Jeremy Miles <jeremy.miles_at_gmail.com>
Date: Fri, 15 Apr 2011 14:17:13 -0700
To: Shane Phillips <SPhillips_at_lexington1.net>
Cc: "r-help_at_r-project.org" <r-help_at_r-project.org>
Subject: Re: [R] Monte Carlo Simulation


>On 15 April 2011 12:03, Shane Phillips <SPhillips@lexington1.net> wrote:
>> Here's a script of what I have so far. I have a few problems. First,
>>the correlations. Next, recoding that categorical variable into
>>dichotomous variables. Finally, the iterative filename thing.
>>
>
> Where?
>
>Perhaps give the list one question at a time?
>
>Here's a start for one of the questions, selected (almost) at random.
>Give 80% of people a score of 1 on a x1, and 20% of people zero.
>
>tempVar <- runif(1000)
>x1 <- ifelse(tempVar < 0.8, 1, 0)
>rm(tempVar)
x1 <- rbinom(1000,1,0.8)
>
>
>Tell us how far you've got. Do you need to know about write.table()
>for the saving the files, or is the problem with splitting a large
>file, or generating the 1000 names ...
>
>
>Jeremy
>
>
>
>--
>Jeremy Miles
>Psychology Research Methods Wiki: www.researchmethodsinpsychology.com
>
>______________________________________________
>R-help_at_r-project.org mailing list
>https://stat.ethz.ch/mailman/listinfo/r-help
>PLEASE do read the posting guide
>http://www.R-project.org/posting-guide.html
>and provide commented, minimal, self-contained, reproducible code.
______________________________________________ R-help_at_r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Received on Fri 15 Apr 2011 - 22:32:21 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Fri 15 Apr 2011 - 23:20:31 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive