[R] a repetition of simulation

2007-11-15 Thread sigalit mangut-leiba
From: sigalit mangut-leiba <[EMAIL PROTECTED]> Date: Nov 15, 2007 3:24 PM Subject: Re: [R] a repetition of simulation To: r-help <[EMAIL PROTECTED]> Hello, In addition to my question a few days ago, Now I have a matrix of the coefficients, how can I see all the P.Values ( Pr(&

Re: [R] a repetition of simulation

2007-11-15 Thread sigalit mangut-leiba
Thank you for all your comments, Sigalit. On 11/15/07, Johannes Hüsing <[EMAIL PROTECTED]> wrote: > > Excuse me, but I think your code deserves some comments. Unfortunately, > the history of postings is in reverse order, so I'll address your > first question first: > > > > >>> The simulation look

Re: [R] a repetition of simulation

2007-11-15 Thread Julian Burgos
summary(log_v) Julian sigalit mangut-leiba wrote: > Hello, > In addition to my question a few days ago, > Now I have a matrix of the coefficients, > how can I see all the P.Values (Pr(>|z|)) of the covariates from the 1000 > iterations? > I tried names(log_v) and couldn'n find it. > Thank you, >

Re: [R] a repetition of simulation

2007-11-15 Thread Johannes Hüsing
Excuse me, but I think your code deserves some comments. Unfortunately, the history of postings is in reverse order, so I'll address your first question first: > > >>> The simulation looks like this: > > >>> > > >>> z <- 0 > > >>> x <- 0 > > >>> y <- 0 > > >>> aps <- 0 > > >>> tiss <- 0 > > >>> fo

Re: [R] a repetition of simulation

2007-11-15 Thread sigalit mangut-leiba
Hello, In addition to my question a few days ago, Now I have a matrix of the coefficients, how can I see all the P.Values (Pr(>|z|)) of the covariates from the 1000 iterations? I tried names(log_v) and couldn'n find it. Thank you, Sigalit. On 11/13/07, Julian Burgos <[EMAIL PROTECTED]> wrote: > >

Re: [R] a repetition of simulation

2007-11-13 Thread Julian Burgos
Well, the obvious (but perhaps not the most elegant) solution is put everything in a loop and run it 600 times. coefficients=matrix(NA,ncol=3,nrow=600) for (loop in 1:600){ [all your code here] coefficients[loop,]=coef(log_v) } That will give you a matrix with the coefficients of each model

Re: [R] a repetition of simulation

2007-11-13 Thread sigalit mangut-leiba
Thank you, I changed that and it's much more efficient. Sigalit. On 11/13/07, Phil Spector <[EMAIL PROTECTED]> wrote: > > You can use the replicate function to do your simulation. First, > put the code to do one repetition in a function: > > dosim0 = function(n=500){ > x <- 0 > y <- 0 > z

Re: [R] a repetition of simulation

2007-11-13 Thread sigalit mangut-leiba
I want to repeat the simulation 600 times and to get a vector of 600 coefficients for every covariate: aps and tiss. Sigalit. On 11/13/07, Julian Burgos <[EMAIL PROTECTED]> wrote: > > And what is your question? > > Julian > > sigalit mangut-leiba wrote: > > Hello, > > I have a simple (?) simulati

Re: [R] a repetition of simulation

2007-11-13 Thread Julian Burgos
And what is your question? Julian sigalit mangut-leiba wrote: > 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:5

Re: [R] a repetition of simulation

2007-11-12 Thread sigalit mangut-leiba
Thank you, Sigalit. On 11/13/07, Moshe Olshansky <[EMAIL PROTECTED]> wrote: > > Hi, > > Look at names(log_v) in your notation to see what you > really need. > Then you could do something like: > > results <- list(600) > for (ij in 1:600) { > do what you did > results[[ij]] <- log_v > } > > So now

Re: [R] a repetition of simulation

2007-11-12 Thread Stephen Weigand
Dear Sigalit, On Nov 12, 2007 2:18 PM, sigalit mangut-leiba <[EMAIL PROTECTED]> wrote: > 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 > ti

[R] a repetition of simulation

2007-11-12 Thread sigalit mangut-leiba
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) a