Message-ID: <BANLkTimYrOsD1qEPN5qZmjHvp_xNXYcg3A@mail.gmail.com>
Date: 2011-04-15T21:17:13Z
From: Jeremy Miles
Subject: Monte Carlo Simulation
In-Reply-To: <F3A26F0214F1064DBDBA68A0FCB6DACB40BC4D0569@LEX1EX1.lcsd1.local>
On 15 April 2011 12:03, Shane Phillips <SPhillips at 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)
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