Displaying 20 results from an estimated 30000 matches similar to: "Simple simulations"
2011 Oct 29
1
How to plot survival data from multiple trials (simulations)?
Dear all:
Could anyone please provide some R codes to plot the below survival data to compare two groups (0 vs 1) after 2 simulations (TRL)? need 95% prediction interval on the plot from these 2 trials. I would like to simulate 1000 trials later. Thanks a lot for your great help and consideration!
yan
TRL ID ECOG BASE PTR8 GROUP POP ST ind
1 1 1 1 2.2636717 0.255634126 1 1 99.4 F
3 1 2 1
2010 Sep 23
2
Error: attempt to apply non-function
This code worked fine for me, then did some cleaning up of formatting using ESS (Emacs) and now I get this error, no idea what is causing it, all the brackets/parentheses seem to be balanced. What have I done wrong?
Thanks
Jim
p0.trial01 <- 0.25
TruOR01 <- 0.80
num.patients.01 <- 50
num.trials.01 <- 5
LOR01.het.in <- 0.00
num.sims <- 1
simLOR01 <-
2012 Jun 18
6
Trying to speed up an if/else statement in simulations
Dear R-help,
I am trying to write a function to simulate datasets of size n which contain
two time-to-event outcome variables with associated 'Event'/'Censored'
indicator variables (flag1 and flag2 respectively). One of these indicator
variables needs to be dependent on the other, so I am creating the first and
trying to use this to create the second using an if/else statement.
2008 Dec 04
2
R simulations
I need help with these R simulations
_______________________________________
The generation of pseudo-random numbers with uniform distribution [0.1]
can be done through a method called Congruencial Committee, which consists
the use of a recursive relationship of the type:
xi +1 = (a.xi + c) mod m
being a, c, and the positive integers m, c <m.
Discuss in light of possible values of a, c, my
2009 Apr 17
5
Binomial simulation
Hi Guy's
I was wondering if someone could point me in the right direction.
dbinom(10,1,0.25)
I am using dbinom(10,1,0.25) to calculate the probabilty of 10 judges
choosing a certain brand x times.
I was wondering how I would go about simulating 1000 trials of each x value
?
regards
Brendan
--
View this message in context:
2006 Mar 18
1
Time-Series, multiple measurements, ANOVA model over time points, analysis advice
Hi,
I have some general questions about statistical analysis for a research
dataset and a request for advice on using R and associated packages for a
valid analysis of this data. I can only pose the problem as how to run
multiple ANOVA tests on time series data, with reasonable controls of the
family-wise error rate. If we run analysis at many small sections of a long
time-series, the Type-I
2010 Jan 13
2
Simulation numbers from a probability table
Dear friends,
If I have a table like this, first row A B C D ... are different
levels of the variable, first column 0 1 2 4 ... are the levels of the
"numbers", the numbers inside the table are the probabilities of the
"number" occuring.
A B C D ...
0 0.2 0.3 0.1 0.05
1 0.1 0.1 0.2 0.2
2 0.02 0.2 0 0.1
4 0.3 0.01 0.01
2006 Jan 06
1
lmer p-vales are sometimes too small
This concerns whether p-values from lmer can be trusted. From
simulations, it seems that lmer can produce very small, and probably
spurious, p-values. I realize that lmer is not yet a finished product.
Is it likely that the problem will be fixed in a future release of the
lme4 package?
Using simulated data for a quite standard mixed-model anova (a balanced
two-way design; see code for the
2012 Jun 27
1
Replacing sets of rows in matrix within a loop
Dear R-help,
I am writing some simulation code to create multiple sets of time-to-event
clinical trial data (for use in meta-analysis). Within each trial, I want to
apply censoring via simulation of uniform variables (with minimum zero and
maximum the median outcome time for that particular trial).
I have started by pre-allocating a matrix which has 3 columns; one for trial
number, one for
2004 Sep 28
3
slow loops in Monte Carlo Simulations
Hi there,
I am running Monte Carlo Simulations in R using ordinary "while
(condition)" loops. Since the number of iterations is something like
100.000 and within each iteration a given subsample is extended
sequentially it takes hours to run the simulation.
Does anyone know if there is either a way to avoid using loops in
Monte Carlo Simulations or how to include possible faster
2008 May 28
5
"rbinom" not using probability of success right
I am trying to simulate a series of ones and zeros (1 or 0) and I am using "rbinom" but realizing that the number of successes expected is not accurate. Any advice out there.
This is the example:
N<-500
status<-rbinom(N, 1, prob = 0.15)
count<-sum(status)
15 percent of 500 should be 75 but what I obtain from the "count" variable is 77 that gives the probability of
2012 May 17
1
Job opportunity in Beijing, China at Xian-Janssen Pharmaceutical Ltd
The Quantitative Decision Strategies group at Janssen Research & Development, Johnson & Johnson, is looking for a candidate to represent QDS in Beijing, China in the subsidiary company of Xian-Janssen Pharmacetical Ltd. The basic requirements for this candidate are 1) 3+ years experience in a quantitative field, but not necessarily pharmaceutical; 2) PhD in statistics or related field
2012 Nov 21
2
plotting 1000 simulations, error message: plot.new has not been called yet
Hi,
I know this is not a mailing list for r, but I posted my question on
several help pages and did not get any help. I really don't know how
to solve my problem, maybe you could help me?
want to simulate stock paths. I have simulated 1000 paths with 22
trading days (1 starting value). Now I want to include it into my
presentation, but animated, so I need the png files.
I want to create 1000
2011 Feb 19
2
reading simulations
Hi to all the people (again),
I'm doing some simulations with the memisc package of an own function, but
I've the problem that I didn't know how to read the result of such
simulations. My function is:
> Torre<-function(a1,N1,a2,N2)
+ {Etorre<-(a1*N1)/(1+a1*N1)
+ Efuera<-(a2*N2)/(1+a2*N2)
+ if(Etorre>Efuera)Subir=TRUE
+ if (Etorre<Efuera)Subir=FALSE
+
2005 Aug 13
2
monte carlo simulations/lmer
Hi - I am doing some monte carlo simulations comparing bayesian (using
Plummer's jags) and maximum likelihood (using lmer from package lme4
by Bates et al).
I would like to know if there is a way I can flag nonconvergence and
exceptions. Currently the simulations just stop and the output reads
things like:
Error in optim(.Call("lmer_coef", x, 2, PACKAGE = "Matrix"), fn,
2004 Mar 10
1
Rank Simulations - Test statistic Help
Hi all,
I am a biostatistician and I have developed my own
ranking system for clinical data. I would like to test
the efficiency of it w.r.t. to other ranking systems.
I would like to simulate the data and after assigning
ranks to my observed scores(after neglecting
dropouts), observe the type I error. If I want to do a
Kruuskal Wallis type of test, what test statistic
should I use to test for a
2004 Jun 14
4
Quirks with system.time and simulations
I tried the code that Richard O'Keefe posted last week, to wit:
library(chron)
ymd.to.POSIXlt <-
function (y, m, d) as.POSIXlt(chron(julian(y=y, x=m, d=d)))
n <- 100000
y <- sample(1970:2004, n, replace=TRUE)
m <- sample(1:12, n, replace=TRUE)
d <- sample(1:28, n, replace=TRUE)
system.time(ymd.to.POSIXlt(y, m, d))
[1] 8.78 0.10
2008 Oct 13
1
Simulations using differential equations
Dear R-users,
I am trying to perform some simulations from a model defined by ordinary
differential equations. I would be grateful if someone could indicate some
functions/packages/examples I could look at.
Thank you in advance.
Sebastien
2011 Jul 25
1
ARIMA simulations
Hello,
I have estimated an ARIMA model and I would like to make simulations from
this estimated model 1,5 and 10 steps ahead. Does anybody know how to do
this?
Thank You
Felipe Parra
[[alternative HTML version deleted]]
2008 Aug 16
4
Lattice: problem using panel.superpose and panel.groups
Hi. I'm embarking on my first attempt at creating my own panel
function for lattice graphics, and despite all of my online research
and pouring through the documentation, I cannot figure out how to
solve my particular problem. Hopefully, a generous fellow R user can
help.
I have some data that is split into two groups: some "actual" data,
and some simulated data,