search for: grps

Displaying 20 results from an estimated 49 matches for "grps".

Did you mean: gaps
2006 Oct 08
1
Simulate p-value in lme4
....) fit0 <- lmer(y ~ 1+(1 | subject), family = poisson, data = epil3.) chisq.sim[i] <- anova(fit0, fit1)[2, "Chisq"] } ************simulation (MM)************ iter <- 10 chisq.sim <- rep(NA, iter) Zt <- slot(model1,"Zt") # see ?lmer-class n.grps <- dim(ranef(model1)[[1]])[1] sd.ran.effs <- sqrt(VarCorr(model1)[[1]][1]) X <- slot(model1,"X") # see ?lmer-class fix.effs <- matrix(rep(fixef(model1),dim(X)[1]), nrow=dim(X)[1], byrow=T) model.parms <- X*fix.effs # This gives parameters for each case #...
2008 Dec 09
2
Need help optimizing/vectorizing nested loops
...Will run the code. Note that I've excised this from a larger, more general function, after determining that for large datasets this section is responsible for a slowdown from 10-12 seconds to ca. 250 seconds. Thanks for your patience, Tyler time.test <- function(dat) { cen <- dat grps <- 5 n.rich <- numeric(grps^2) n.ind <- 1 for(i in 1:grps) for (j in 1:grps) { n.cen <- numeric(ncol(cen) - 2) neighbours <- expand.grid((j-1):(j+1), (i-1):(i+1)) neighbours <- neighbours[-5,] neighbours <- neighbours[which(neighbours[,1]...
2009 Jan 22
1
convergence problem gamm / lme
...ctor. There are no extreme outliers in lat/lon. The model we try to fit is: > gamm3<-gamm(count~offset(offsetter)+s(lon,lat),random=list(code_tripnr=~1),family="poisson", niterPQL=200) Maximum number of PQL iterations: 200 iteration 1 iteration 2 Error in MEestimate(lmeSt, grps) : NA/NaN/Inf in foreign function call (arg 1) We tried several things. We added some noise to lon and lat, modelled the density instead of using a count with model offset, and we normalized the explanatory variables. We also changed several settings (see models below). Interestingly, w...
2009 Jul 07
3
Numbering sequences of non-NAs in a vector
Greetings, I have a vector of the form: [10,8,1,3,0,8,NA,NA,NA,NA,2,1,6,NA,NA,NA,0,5,1,9...] That is, a combination of sequences of non-missing values and missing values, with each sequence possibly of a different length. I'd like to create another vector which will help me pick out the sequences of non-missing values. For the example above, this would be:
2004 Apr 05
3
2 lme questions
Greetings, 1) Is there a nice way of extracting the variance estimates from an lme fit? They don't seem to be part of the lme object. 2) In a series of simulations, I am finding that with ML fitting one of my random effect variances is sometimes being estimated as essentially zero with massive CI instead of the finite value it should have, whilst using REML I get the expected value. I guess
2016 Apr 08
3
Generating Hotelling's T squared statistic with hclust
I am doing a cluster analysis with hclust. I want to get hclust to output the Hotelling's T squared statistic for each cluster so I can evaluate is data points should be in a cluster or not. My research to answer this question has been unsuccessful. Does anyone know how to get hclust to output the Hotelling's T squared statistic for each cluster? Mike [[alternative HTML version
2011 Jan 20
2
circular reference lines in splom
...o everyone, I'm stumped. I'd like to create a scatterplot matrix with circular reference lines. Here is an example in 2d: library(ellipse) set.seed(1) dat <- matrix(rnorm(300), ncol = 3) colnames(dat) <- c("X1", "X2", "X3") dat <- as.data.frame(dat) grps <- factor(rep(letters[1:4], 25)) panel.circ <- function(x, y, ...) { circ1 <- ellipse(diag(rep(1, 2)), t = 1) panel.xyplot(circ1[,1], circ1[,2], type = "l", lty = 2) circ2 <- ellipse(diag(rep(1, 2)), t = 2) panel.xyplot(circ...
2017 May 10
2
bug report: nlme model-fitting crashes with R 3.4.0
...########################################################################## library(nlme) #Using version 3.1-131 #Windows 7 64-bit operating system fm2 <- lme(distance ~ age + Sex, data = Orthodont, random = ~ 1) # Error in array(c(rep(1, p), .C(inner_perc_table, as.double(X), as.integer(unlist(grps)), : # object 'inner_perc_table' not found # #Upon debugging, this error is thrown with line 135 of lme.formula() code. # #fixDF <- getFixDF(X, grps, attr(lmeSt, "conLin")$dims$ngrps, lme(distance ~ age + Sex, data = Orthodont, random = ~ 1|Subject) # Error in array(c(rep(1,...
2004 Jun 22
2
function not in load table
...l as the R wrapper functions which I want to use for faster calculations. These functions are included in a R package. The installation process seems to be ok (no errors). I also can load the package without errors. But when I call the function I got the following error > wy.result <- wy.grps(data1=X1, grpdata=groups, nres=10000, alpha1=0.05, alpha2=0.05) Error in .C("wy_grps_R", as.double(X), as.integer(n1), as.integer(n2), : C function name not in load table Execution halted The parameter are data1 - result of read.table() grpdata - dito nres - integer alpha1 nad...
2000 Jun 04
2
mle (PR#560)
...ogical(now)) : unable to load shared library "C:\PROGRAM\R\RW1000/library/nls/libs/nls.dll": LoadLibrary failure > data(Orthodont) > fm1 <- lme(distance ~ age, data = Orthodont) # random is ~ age Error in .C("inner_perc_table", as.double(X), as.integer(unlist(grps)), : C/Fortran function name not in load table > fm2 <- lme(distance ~ age + Sex, data = Orthodont, random = ~ 1) Error in .C("inner_perc_table", as.double(X), as.integer(unlist(grps)), : C/Fortran function name not in load table What is wrong? Could it be the p...
2008 Nov 06
2
need help in plotting barchart
...by.n <- ifelse(abs(diff(ylim)) <= 5, 1, 2) at <- seq(from=0, to = ylim[2], by = by.n) lbls <- format(2^at) yscales <- list(y=list(at = at, labels = lbls)) ## log base 2 ticks scales = c(list(...)$xscales, yscales) ## combine passed scales, if any grps <- df[[group.var]][ok, drop = FALSE] cond <- df[[cond.var]][ok, drop = FALSE] j <- match(group.var, names(df)) names(df)[j] <- "grps" j <- match(cond.var, names(df)) names(df)[j] <- "cond" f <- formula(sprintf("counts ~ %s...
2009 Sep 08
2
CallerID app for Symbian?
Hi, we're using a GSM-Gateway on asterisk to forward incoming calls to the cellphones, but, of course, the cellphones always display the callerid from the gateway. Does anyone know a symbian app that could (on an incoming call) connect via grps/3G to a database behind the asterisk and fetch the real callerid and do a calleridname-lookup on a number? -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.digium.com/pipermail/asterisk-users/attachments/20090908/788ced20/attachment.htm
2011 Mar 17
2
fitting gamm with interaction term
...m model of the form: Y~X+X*f(z) Where f is the smooth function and With random effects on X and on the intercept. So, I try to write it like this: gam.lme<- gamm(Y~ s(z, by=X) +X, random=list(groups=pdDiag(~1+X)) ) but I get the error message : Error in MEestimate(lmeSt, grps) : Singularity in backsolve at level 0, block 1 When I simply fit a gam model using the formula above, then it works ok. Is it possible to fit such a model with gamm? Thanks a lot! [[alternative HTML version deleted]]
2003 Nov 29
3
performance gap between R 1.7.1 and 1.8.0
Dear R-help, A colleague of mine was running some code on two of our boxes, and noticed a rather large difference in running time. We've so far isolated the problem to the difference between R 1.7.1 and 1.8.0, but not more than that. The exact same code took 933.5 seconds in 1.7.1, and 3594.4 seconds in 1.8.1, on the same box. Basically, the code calls boot() to bootstrap fitting mixture
2017 May 11
0
bug report: nlme model-fitting crashes with R 3.4.0
...######################################### > library(nlme) > #Using version 3.1-131 > #Windows 7 64-bit operating system > > fm2 <- lme(distance ~ age + Sex, data = Orthodont, random = ~ 1) > > # Error in array(c(rep(1, p), .C(inner_perc_table, as.double(X), as.integer(unlist(grps)), : > # object 'inner_perc_table' not found > # > #Upon debugging, this error is thrown with line 135 of lme.formula() code. > # > #fixDF <- getFixDF(X, grps, attr(lmeSt, "conLin")$dims$ngrps, > > lme(distance ~ age + Sex, data = Orthodont, random = ~ 1|S...
2007 Nov 11
0
Patch to sshd match
...sclaimer.h> -------------- next part -------------- --- servconf.c.orig 2007-05-20 06:03:16.000000000 +0100 +++ servconf.c 2007-11-11 17:21:38.000000000 +0000 @@ -498,13 +498,21 @@ * PermittedChannelRequests session,forwarded-tcpip */ +/* Check if user is in the comma separated group list grps. Invert condition if not. + * line is the config file line. + * Return: + * 1 match + * 0 not match + * -1 error + */ static int -match_cfg_line_group(const char *grps, int line, const char *user) +match_cfg_line_group(const char *grps, int line, const char *user, int not) { int result = 0; u...
2008 Oct 16
3
how to count unique observations by variables
Dear R-helpers, I have a data frame with 3 variables, each record is a unique combination of the three variables. I would like to count the number of unique values of v3 in each v1, and save it as a new variable v4 in the same data frame. e.g. df1 [v1] [v2] [v3] [1,] "a" "C" "1" [2,] "b" "C" "2" [3,] "c" "B"
2012 Jun 06
3
Sobel's test for mediation and lme4/nlme
...2, 1])^2 * (mod2.out[3, 2])^2 + (mod2.out[3, 1])^2 * (mod3.out[2, 2])^2 serr <- sqrt(effvar) zvalue = indir/serr out <- list(Model.1 = mod1.out, Model.2 = mod2.out, Model.3 = mod3.out, Indirect.Effect = indir, SE = serr, z.value = zvalue, N = nrow(NEWDAT),n.grps=length(unique(NEWDAT$grpid))) return(out) } Any help much appreciated! Best, Gavril -- Gavril Bilev, PhD Department of Political Science Brown University Providence, RI 02906 [[alternative HTML version deleted]]
2009 Dec 09
1
Exporting Contingency Tables with xtable
Dear R-philes: I am having an issue with exporting contingency tables with xtable(). I set up a contingency and convert it to a matrix for passing to xtable() as shown below. v.cont.table <- table(v_lda$class, grps, dnn=c("predicted", "observed")) v.cont.mat <- as.matrix(v.cont.table) Both produce output as follows: observed predicted uh uh~ uh 201 30 uh~ 6 10 However, when I construct the latex table with xtable(v.cont.mat), I get a good table without the...
2007 May 17
1
creating columns
...ce treatmentgrp strata 1 1 1 1 1 1 1 2 1 2 1 2 2 1 2 1 2 1 2 2 2 2 2 2 l should be able to choose the size of the treatment grps and stratas the method l used intially creates the matrice randomly n=20 m <- cbind( treatmentgrp = sample( 1:2,n, replace=T ), strata = sample( 1:2, n, replace=T ), survivalTime = rexp( n, rate=0.07 ), somethingElse = rexp( n, ra...