similar to: error in predict glm (new levels cause problems)

Displaying 20 results from an estimated 800 matches similar to: "error in predict glm (new levels cause problems)"

2005 Aug 16
1
predict nbinomial glm
Dear R-helpers, let us assume, that I have the following dataset: a <- rnbinom(200, 1, 0.5) b <- (1:200) c <- (30:229) d <- rep(c("q", "r", "s", "t"), rep(50,4)) data_frame <- data.frame(a,b,c,d) In a first step I run a glm.nb (full code is given at the end of this mail) and want to predict my response variable a. In a second step, I would
2012 Sep 04
5
Associations and Math between Models
I''ve setup two models, 1 and 2, that are associated by has_and_belongs_to_many. I''m trying to get an attribute from model_1 to use in a method in model_2. When I use the code below, I get an error saying ''undefined method model_1_id''. What am I missing? Thanks! Model_2.rb Class Model_2 < ActiveRecord::Base ... has_and_belongs_to_many :model_1 def
2006 Aug 26
1
problems with loop
Dear all, I am trying to evaluate the optimisation behaviour of a function. Originally I have optimised a model with real data and got a set of parameters. Now I am creating simulated data sets based on these estimates. With these simulations I am estimating the parameters again to see how variable the estimation is. To this end I have written a loop which should generate a new simulated data
2006 Jul 28
2
negative binomial lmer
To whom it may concern: I have a question about how to appropriately conduct an lmer analysis for negative binomially distributed data. I am using R 2.2.1 on a windows machine. I am trying to conduct an analysis using lmer (for non-normally distributed data and both random and fixed effects) for negative binomially distributed data. To do this, I have been using maximum likelihood,
2005 May 14
1
lda
Dear R-helpers, if I am right a discriminant analysis can be done with "lda". My questions are: 1. What method to discriminate the groups is used by "lda" (Fisher's linar discriminant function, diagonal linear discriminant analysis, likelihood ratio discriminant rule, ...)? 2. How can I see, which method is used? (Typing just lda does not give me any code). Thank you in
2009 Dec 10
1
Samba PDC LDAP and LDAP Aliases
Hello all I've got a problem with unresolved (at least I guess that) LDAP Aliases and Samba. That's my LDAP Setup: ou=alvhaus,ou=ch { base } ou=People,ou=alvhaus,ou=ch { posix and samba accounts } ou=Group,ou=alvhaus,ou=ch { posix and samba groups } ou=Samba,ou=alvhaus,ou=ch { samba base dn } ou=Idmap,ou=Samba,ou=alvhaus,ou=ch ou=Machines,ou=Samba,ou=alvhaus,ou=ch
2009 Mar 18
1
error with effects package.
Dear R helpers, I have the following model model_1<-glm(y~A+B+C+E+A:D,contrasts=list(D=contrasts_D),data=mydata,na.action=na.omit) with: options(contrasts=c("contr.sum", "contr.poly")) A,B and E are 2-levels factor, C is covariate, D is 20 levels factor with 10 in relation with the first levels of factor A, the other in relation with the second levels of factor A
2009 Jun 26
1
Alternate error structures in lme4?
Hi R users, The nlme library enabled several alternate error structures useful for longitudinal or repeated-measures data. For example, a continuous AR(1) process: model_2 = update(model_1, correlation = corCAR1(form = ~ time | subject)) Does anybody know if this is available in lme4? Thank you Ben -- View this message in context:
2005 Feb 23
3
bias of a boot statistic
Question: How can I get access to the bias value of a boot statistic? Details: Boot function: boot(data, statistic, R, sim="ordinary", stype="i", strata=rep(1,n), L=NULL, m=0, weights=NULL, ran.gen=function(d, p) d, mle=NULL, ...) When I create an object, containing the bootstrap statistic (object <- boot (....))I can call it and will get an output
2009 Nov 08
2
reference on contr.helmert and typo on its help page.
I'm wondering which textbook discussed the various contrast matrices mentioned in the help page of 'contr.helmert'. Could somebody let me know? BTW, in R version 2.9.1, there is a typo on the help page of 'contr.helmert' ('cont.helmert' should be 'contr.helmert').
2003 Oct 08
1
Contrast specified with C() - R vs S-Plus problem
Hi, For a n-level factor, I'd like to specify the first contrast and have the remaining n-2 constructed automatically so that the set is orthogonal. I then test the contrasts with summary.lm(anova-object). In S-Plus, the following works: >y.anova <- aov( y ~ C(CO2,c(1,0,-1)) ) >summary.lm(y.anova) In R, it fails with the following error: >levels(CO2) [1]
2008 Sep 30
2
plot inside graphic area
I am trying to plot a small graphic inside the graphic area of a bigger graphic. Does anybody know the commend for that? Thanks a lot! -- MSc José Alberto F. Monteiro Botanisches Institut Universität Basel السلام عليكم [[alternative HTML version deleted]]
2006 Aug 22
1
summary(lm ... conrasts=...)
Hi Folks, I've encountered something I hadn't been consciously aware of previously, and I'm wondering what the explanation might be. In (on another list) using R to demonstrate the difference between different contrasts in 'lm' I set up an example where Y is sampled from three different normal distributions according to the levels ("A","B","C")
2005 Apr 13
2
multinom and contrasts
Hi, I found that using different contrasts (e.g. contr.helmert vs. contr.treatment) will generate different fitted probabilities from multinomial logistic regression using multinom(); while the fitted probabilities from binary logistic regression seem to be the same. Why is that? and for multinomial logisitc regression, what contrast should be used? I guess it's helmert? here is an example
2005 Jun 23
4
contrats hardcoded in aov()?
On 6/23/05, RenE J.V. Bertin <rjvbertin at gmail.com> wrote: > Hello, > > I was just having a look at the aov function source code, and see that when the model used does not have an Error term, Helmert contrasts are imposed: > > if (is.null(indError)) { > ... > } > else { > opcons <- options("contrasts") >
2004 Mar 03
1
Confusion about coxph and Helmert contrasts
Hi, perhaps this is a stupid question, but i need some help about Helmert contrasts in the Cox model. I have a survival data frame with an unordered factor `group' with levels 0 ... 5. Calculating the Cox model with Helmert contrasts, i expected that the first coefficient would be the same as if i had used treatment contrasts, but this is not true. I this a error in reasoning, or is it
2005 Jul 08
2
extract prop. of. var in pca
Dear R-helpers, Using the package Lattice, I performed a PCA. For example pca.summary <- summary(pc.cr <- princomp(USArrests, cor = TRUE)) The Output of "pca.summary" looks as follows: Importance of components: Comp.1 Comp.2 Comp.3 Comp.4 Standard deviation 1.5748783 0.9948694 0.5971291 0.41644938 Proportion of Variance 0.6200604
2005 Aug 29
1
lme and ordering of terms
Dear R users, When fitting a lme() object (from the nlme library), is it possible to test interactions *before* main effects? As I understand, R conventionally re-orders all terms such that highest-order interactions come last - but I??d like to know if it??s possible (and sensible) to change this ordering of terms. I??ve tried the terms() command (from aov) but I don??t know if something
2001 Jun 15
1
contrasts in lm and lme
I am using RW 1.2.3. on an IBM PC 300GL. Using the data bp.dat which accompanies Helen Brown and Robin Prescott 1999 Applied Mixed Models in Medicine. Statistics in Practice. John Wiley & Sons, Inc., New York, NY, USA which is also found at www.med.ed.ac.uk/phs/mixed. The data file was opened and initialized with > dat <- read.table("bp.dat") >
2006 Sep 29
1
Helmert contrasts for repeated measures and split-plot expts
Dear R-help I have two separate experiments, one a repeated-measures design, the other a split-plot. In a standard ANOVA I have usually undertaken a multiple-comparison test on a significant factor with e.g TukeyHSD, but as I understand it such a test is inappropriate for repeated measures or split-plot designs. Is it therefore sensible to use Helmert contrasts for either of these designs?