[R] prediction in a loop with only one sample

2013-05-11 Thread asdf1234
Dear all, I have a sample with 920 observations. I want to create a loop which takes 300 of these observations for the prediction and the rest to estimate the model. My idea was to create something like this: cs.training.dat <- read.table... cs.training.dat_sub1 <- subset(cs.training.dat,

[R] creating multivariate normal random variables

2013-05-09 Thread asdf1234
Dear R experts, I am trying to create a dataset, with one dependent binomial and one independen (normal) variable. I have the condition that my x should be created in the following way: if y=0 my x should have mean=0.2 and variance=1 if y=1 my x should have mean=0.7 and variance=1 Furthermore, my