search for: sim

Displaying 20 results from an estimated 1215 matches for "sim".

Did you mean: sig
2013 Mar 08
4
Substitute value
...t;, "1234", "2a", "2"). However there are some individual codes which do not have a last component (eg. 2.4356.3b. ), I want to give these codes a "1" as their last component (eg. 2.4356.3b.1) but I can't get it to work. This is my example and attempt: sim.code<-c("1.1234.1a.1","1.1234.1a.2","1.3245.2c.5","4.6743.3c.","4.3254.6b.4","3.5463.2a.") sim.val<-c(4,5,3,6,4,7) sim.df<-data.frame(sim.code,sim.val) sim.df$sim.code2<-sub(".$",".1",sim.df$sim.code) sim.d...
2008 Jul 14
2
Backslash in sub pattern?
Dear guRus, I am trying to replace "~" by "$\sim$" for TeX. However, I can't get the backslash to work. I would like to turn "DV~IV" into "DV$\sim$IV". sub("~","$\sim$","DV~IV") => "DV$sim$IV" sub("~","$\\sim$","DV~IV") => "DV$sim$IV&qu...
2004 Aug 25
1
brlr function
...logistic regression function. However, I am not sure why I am encountering errors. I hope to seek your advice here. (output below) Thank you! Your help is truly appreciated. Min-Han #No error here, the glm seems to work fine > genes.cox1.glm1<-glm(as.formula(paste(paste('as.integer(sim.cv.cox.yhat1)~'),paste('sim.dat.tst[',genes.cox1.rows,',]',sep="",collapse='+')))) #Something happened here ... I only substituted brlr for glm > genes.cox1.glm1<-brlr(as.formula(paste(paste('as.integer(sim.cv.cox.yhat1)~'),paste('sim.dat.ts...
2007 May 01
2
Simulation using parts of density function
Hi My simulation with the followin R code works perfectly: sim <- replicate(999, sum(exp(rgamma(rpois(1,2000), scale = 0.5, shape = 12)))) But now I do not want to have values in object "sim" exceeding 5'000'000, that means that I am just using the beginning of densitiy function gamma x...
2008 Feb 03
1
Effect size of comparison of two levels of a factor in multiple linear regression
...way to determine confidence intervals for the effect sizes derived below and would appreciate tips on that. set.seed(123456) # Make session reproducible # Set up the treatment factor with three levels and 100 observations # each treatment <- factor(c(rep(0, 100), rep(1, 100), rep(2, 100))) # Simulate outcomes outcome <- rep(NA, 300) outcome[treatment==0] <- rnorm(100, 10, 5) # baseline: mean=10, sd=5 outcome[treatment==1] <- rnorm(100, 30, 5) # effect size 4 outcome[treatment==2] <- rnorm(100, 40, 5) # effect size 6 # Check effect sizes (Cohen's d) cohens.d <- function...
2009 Feb 05
3
seq(along= surprise
This surprised me: > reps <- 100 > sims <- list(length=reps) > sims $length [1] 100 > for(i in seq(along=sims))print(i) [1] 1 > This is R 2.8.1. Kjetil [[alternative HTML version deleted]]
2010 Oct 20
3
Plot help
...rough the various programmes ggplot, lattice, hmisc etc but my case seems to be not metnioned, maybe it is but i have not noticed - if this is the case i apologise. ***************************************************************************************************************** #I have a series of simulated values, which are means sim <- c(0.0012,0.0009,2,2,9,12,0.0009,2,19,1,1,0.0013,1,0.0009,0.0009,1,26,3,1,2,1,0.0009,1,0.2323,4,2,0.0009,0.0009,0.0009,52,49,1,3,7) #and actual values actual <- c(0,0,2,0,13,20,0,3,38,0,0,0,1,0,0,0,27,2,0,0,1,0,1,0,4,2,0,0,0,54,21,0,4,11) #The "X&...
2008 Jan 14
7
GSM SIM Cards and Digium, or GSM SIM Adaptor
Hi List; Is there an Digium cards support GSM SIM cards so we can fix an SIM card to be used for calls within mobiles as it is less rate? Or I have to use an FXS to SIM adaptor? If yes, then anyone advise a models and prices? Regards Bilal ____________________________________________________________________________________ Be a better fr...
2007 Jun 01
0
Metropolis code help
...h/458/metropolis.r Below is My code with a flat prior on beta only (I'd like also to have the hierarchical version!) X<- cbind(1,DF$nsaid,DF$diuretic,DF$diuretic*DF$nsaid) y<- DF$Var3 Metropolis <- function(logtarget, start, R = 1000, sd = 1) { parmcount <- length(start) sims <- matrix(NA, nrow=R, ncol = parmcount) colnames(sims) <- names(start) sims[1,] <- start oldlogalpha <- logtarget(start) accepts <- 0 for (i in 2:R) { jump <- rnorm(parmcount, mean=0, sd=sd) y <- sims[i-1,] + jump newlogalpha <- logtarget(y) i...
2006 Sep 20
4
Calculating mean together with split
Hi I have a table called npl containing results of simulations. It contains about 19000 entries and the structure looks like this: NoPlants sim run year DensPlants 1 6 lng_cs99_renosterbos 1 4 0.00192 . . . it has 43 different entries for sim and year goes from 1 to 100, and run from 1 to 5. I would like to calcu...
2008 Mar 05
2
simulating the anova
I have been trying to figure out how to run a simple simulation of the ANOVA and I'm coming up just a bit short. The code I've got is: cohen.f = .25 groups = 4 between.var = 19 within.var = between.var / cohen.f ^ 2 n = 500 sim.means = rnorm(n = groups, mean = 0, sd = sqrt(between.var)) sim.data = lapply(sim.means, function(mean) rnorm(n...
2005 Apr 13
1
i param in "for" loop does not takes zeros?
Hi all Is there any reason why the parameter i in a "for" loop ignores a value of zero? For example sim=c() p=.2 for(i in 0:5) {sim[i]=dbinom(i,5,p) } sim [1] 0.40960 0.20480 0.05120 0.00640 0.00032 In this example the quantile i= 0 was ignored since dbinom(0,5,p) [1] 0.32768 The same behaviour occurs if I use a while loop to perform the same calculation: sim=c() p=.2 i=0 while(i <6) {s...
2004 May 24
1
Null model for arima.sim().
In some time series simulations I'm doing, I occasionally want the model to be ``white noise'', i.e. no model at all. I thought it would be nice if I could fit this into the arima.sim() context, without making an exceptional case. I.e. one ***could*** do something to the effect if(length(model)==0) x <-...
2019 May 15
1
domain still running although snapshot-file is deleted !?!
...d hours ago. And the domain is still running. I can login via ssh, the database and the webserver are still running, domain is performant. How can that be ? Also lsof shows that the file is deleted: qemu-syst 27007 qemu 15ur REG 254,14 335609856 183599 /mnt/snap/sim.sn (deleted) qemu-syst 27007 qemu 16ur REG 254,14 335609856 183599 /mnt/snap/sim.sn (deleted) qemu-syst 27007 27288 qemu 15ur REG 254,14 335609856 183599 /mnt/snap/sim.sn (deleted) qemu-syst 27007 27288 qemu 16ur REG...
2005 Oct 10
1
using innov in arima.sim
Hello, I have used the arima.sim function to generate a lot of time series, but to day I got som results that I didn't quite understand. Generating two time series z0 and z1 as eps <- rnorm(n, sd=0.03) z0 <- arima.sim(list(ar=c(0.9)), n=n, innov=eps) and z1 <- arima.sim(list(ar=c(0.9)), n=n, sd=0.03), I would exp...
2005 Oct 02
2
arima.sim bug?
Hi, I am using the arima.sim function to generate some AR time series. However, the function does not seem to produce exactly the same time series when I specify the innov parameter. For example > r <- rnorm(300) > x <- arima.sim(300, model=list(order=c(1,0,0),ar=c(.96)), innov=r, n.start=10) > y <- arima.si...
2002 Feb 25
2
The Sims
I have a copy of the Sims installed on a Win2k FAT32 partition. I know for a fact that The Sims works under Wine (Mandrake's "Gamer" edition), but I get an error when I try to run it. The error is as follows: "Game cannot be started because: There is not enough memory or hard drive space to run. E...
2010 Aug 19
1
How to include trend (drift term) in arima.sim
I have been trying to simulate from a time series with trend but I don't see how to include the trend in the arima.sim() call. The following code illustrates the problem: # Begin demonstration program x <- c(0.168766559, 0.186874000, 0.156710548, 0.151809531, 0.144638812, 0.142106888, 0.140961714, 0.13...
2006 Jan 13
1
Variance-covariance by factor
...r all, I have a data frame with one factor and four numeric variables and wish to obtain the var-cor matrix separately by factor. I tried by() and sapply() but getting nowhere. I understand this can be done by subsetting the dataframe, but there should have some sleek ways of doing it. Here is a simulated dataframe; s <- rep(c("A","B","C"), c(25,22,18)) d <- c(rnorm(25,14,2.6),rnorm(22,15.2,2.8),rnorm(18,16.4,3.0)) h <- c(rnorm(25,10,1.4),rnorm(22,11.2,1.8),rnorm(18,12.3,2.0)) l <- c(rnorm(25,6.8,1.6), rnorm(22,7.0,1.7),rnorm(18,7.3,1.8)) w <- c(r...
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 t...