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(&
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
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,
>
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
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:
>
>
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
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
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
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
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
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
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
12 matches
Mail list logo