Displaying 2 results from an estimated 2 matches for "tiss".
Did you mean:
miss
2007 Nov 12
4
a repetition of simulation
Hello,
I have a simple (?) simulation problem.
I'm doing a simulation with logistic model and I want to reapet it 600
times.
The simulation looks like this:
z <- 0
x <- 0
y <- 0
aps <- 0
tiss <- 0
for (i in 1:500){
z[i] <- rbinom(1, 1, .6)
x[i] <- rbinom(1, 1, .95)
y[i] <- z[i]*x[i]
if (y[i]==1) aps[i] <- rnorm(1,mean=13.4, sd=7.09) else aps[i] <-
rnorm(1,mean=12.67, sd=6.82)
if (y[i]==1) tiss[i] <- rnorm(1,mean=20.731,sd=9.751) else tiss[i] <-
rnorm(1,mean=18.5...
2007 Nov 08
1
how to generate data in a simulation study
hello,
I have a problem in how to generate data in a simulation study.
I have a logistic model to evaluate p by 3 covariates.
I need to generate 4 variables: the binary outcome Y and 3 covariates:
gender (binary) and aps and tiss (continuous variables).
I have the logistic model which is the expected model:
log(p(y=1)/(1-p(y=1))=-1.659-0.05*sex+0.063*aps+0.04*tiss0)
I generate the outcome y like this:
for (i in 1:500){
z1[i] <- rbinom(1, 1, .6)
x1[i] <- rbinom(1, 1, .95)
y1[i] <- z1[i]*x1[i]
}
my question is...