similar to: Defining S3-methods for S4-objects: cannot coerce type 'S4' to vector of type 'integer'

Displaying 20 results from an estimated 200 matches similar to: "Defining S3-methods for S4-objects: cannot coerce type 'S4' to vector of type 'integer'"

2008 Apr 16
2
Post hoc tests with lme
Using the "ergoStool" data cited in Mixed-Effects Models in S and S-PLUS by Pinheiro and Bates as an example, we have ======== > library(nlme) > fm <- lme(effort~Type-1, data=ergoStool, random=~1|Subject) > summary(fm) Linear mixed-effects model fit by REML Data: ergoStool AIC BIC logLik 133.1308 141.9252 -60.5654 Random effects: Formula: ~1 | Subject
2009 Sep 06
1
Concentration ellipsoid
Hi all, Can anyone please guide me how to draw a Concentration ellipsoid for a bivariate system with a bivariate normal dist. having a VCV matrix : Sigma <- matrix(c(1,2,2,5), 2, 2) I would like to draw in using GGPLOT. Your help will be highly appreciated. Thanks, -- View this message in context: http://www.nabble.com/Concentration-ellipsoid-tp25315705p25315705.html Sent from the R help
2013 Mar 06
1
Difficulty in caper: Error in phy$node.label[which(newNb > 0) - Ntip]
Hello, I'm doing a comparative analysis of mammal brain and body size data. I'm following Charlie Nunn and Natalie Cooper's instructions for "Running PGLS in R using caper". I run into the following error when I create my comparative dataset, combining my phylogenetic tree (mammaltree) and taxon measures (mammaldata): "Error in phy$node.label[which(newNb > 0) -
2001 Dec 06
2
Contrasts in lm
Dear all, In SAS (GLM and MIXED) estimable functions (linear functions of the parameters) can be specified in the ESTIMATE and CONTRAST statements. Has anyone written a similar "utility" for use in connection with lm? Thanks in advance S?ren H?jsgaard -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-help mailing list -- Read
2012 Oct 27
0
[gam] [mgcv] Question in integrating a eiker-white "sandwich" VCV estimator into GAM
Dear List, I'm just teaching myself semi-parametric techniques. Apologies in advance for the long post. I've got observational data and a longitudinal, semi-parametric model that I want to fit in GAM (or potentially something equivalent), and I'm not sure how to do it. I'm posting this to ask whether it is possible to do what I want to do using "canned" commands
2007 Jul 25
2
using contrasts on matrix regressions (using gmodels, perhaps)
Hi, I want to test for a contrast from a regression where I am regressing the columns of a matrix. In short, the following. X <- matrix(rnorm(50),10,5) Y <- matrix(rnorm(50),10,5) lm(Y~X) Call: lm(formula = Y ~ X) Coefficients: [,1] [,2] [,3] [,4] [,5] (Intercept) 0.3350 -0.1989 -0.1932 0.7528 0.0727 X1 0.2007 -0.8505 0.0520
2006 May 10
1
ape comparative analysis query
I've been comparing variables among objects (taxa) related by known trees, using phylogentically independent contrasts in the ape package, and want to move on to more complex models e.g. by using gls with appropriate correlation terms. My trees contain lots of (hard) polytomies and information about ancestors, which I've been including- creating fully dichotomous trees by using zero branch
2008 May 12
1
Standard error of combination of parameter estimates
Hi, Is there a simple command for computing the standard error of a combination of parameter estimates in a GLM? For example: riskdata$age1 <- riskdata$age riskdata$age2 <- ifelse(riskdata$age<67,0,riskdata$age-67) model <- glm(death~age1+age2+ldl, data=riskdata,family=binomial(link=logit)) And we want to find the standard error of the partial linear predictor for
2011 Aug 04
0
phyres function in caper package
## I clicked the send-button too quickly, before changing the title of the message etc... Sorry.## I am running following phylogenetic analyses with the caper package: data=read.table(file="data.txt",header=T,sep="\t") tree = read.nexus("Tree.nex") primate = comparative.data(phy=tree, data=data,              names.col=Species, vcv=TRUE, na.omit=FALSE,
2012 Jun 18
0
Obtaining r-squared values from phylogenetic autoregression in ape
Hello, I am trying to carry out a phylogenetic autoregression to test whether my data show a phylogenetic signal, but I keep calculating bizzare R-squared values. My script is: > library(ape) > x <-
2008 May 09
1
Which gls models to use?
Hi, I need to correct for ar(1) behavior of my residuals of my model. I noticed that there are multiple gls models in R. I am wondering if anyone has experience in choosing between gls models. For example, how should one decide whether to use lm.gls in MASS, or gls in nlme for correcting ar(1)? Does anyone have a preference? Any advice is appreciated! Thanks, -- Tom [[alternative HTML
2012 Nov 29
1
[mgcv][gam] Manually defining my own knots?
Dear List, I'm using GAMs in a multiple imputation project, and I want to be able to combine the parameter estimates and covariance matrices from each completed dataset's fitted model in the end. In order to do this, I need the knots to be uniform for each model with partially-imputed data. I want to specify these knots based on the quantiles of the unique values of the non-missing
2018 Mar 01
0
scale.default gives an incorrect error message when is.numeric() fails on a dgeMatrix
>>>>> Michael Chirico <michaelchirico4 at gmail.com> >>>>> on Tue, 27 Feb 2018 20:18:34 +0800 writes: Slightly amended 'Subject': (unimportant mistake: a dgeMatrix is *not* sparse) MM: modified to commented R code, slightly changed from your post: ## I am attempting to use the lars package with a sparse input feature matrix, ## but the following
2018 Feb 27
2
scale.default gives an incorrect error message when is.numeric() fails on a sparse row matrix (dgeMatrix)
I am attempting to use the lars package with a sparse input feature matrix, but the following fails: library(Matrix) library(lars) data(diabetes) attach(diabetes) x = as(as.matrix(as.data.frame(x)), 'dgCMatrix') lars(x, y, intercept = FALSE) Error in scale.default(x, FALSE, normx) : > > length of 'scale' must equal the number of columns of 'x' > > More
2007 Nov 01
1
Matrix package problem: dsyMatrix %*% vector gives error
Dear UseRs, here is an example scenario presenting my problem: Multiplying a dsyMatrix with a numeric vector results in an error (unfortunately in German due to my locale): > (M1 <- Matrix( c( 1, 2, 2, 2, 1, 2, 2, 2, 1), nrow = 3)) 3 x 3 Matrix of class "dsyMatrix" [,1] [,2] [,3] [1,] 1 2 2 [2,] 2 1 2 [3,] 2 2 1 > M1 %*% 1:3 Fehler in x %*%
2013 Jan 28
2
Why are the number of coefficients varying? [mgcv][gam]
Dear List, I'm using gam in a multiple imputation framework -- specifying the knot locations, and saving the results of multiple models, each of which is fit with slightly different data (because some of it is predicted when missing). In MI, coefficients from multiple models are averaged, as are variance-covariance matrices. VCV's get an additional correction to account for how
2020 Sep 11
2
more Matrix weirdness
> > "These operators are also implicit S4 generics, but as > > primitives, S4 methods will be dispatched only on S4 > > objects ?x?." > Yes, exactly, very well found, Georgi! I'm sorry Martin, but I don't understand your point here. I'm assuming that you want the (S3) matrix, x, to be converted to an (S4) Matrix. However, this is not a
2010 Jan 12
1
coerce vector into array - change filling sequence
Dear all, When I coerce a vector into a multi dimensional array, I would like R to start filling the array along the last dimension, then the 2nd last etc. Let's jump straight into an example. x <- 1 : 24 y <- array(dim=c(2,2,6)) I would like to have: y[1,1,1] = 1 y[1,1,2] = 2 ... y[1,1,6] = 6 y[1,2,1] = 7 y[1,2,2] = 8 ... y[2,1,1] = 13 ... y[2,2,1] = 19 if I do y<- array(x,
2009 Feb 05
0
plotrix::thigmophobe could usefully coerce to numeric...
thigmophobe.labels() fails with error when supplied with an array resulting from tapply (example below). The error originates in thigmophobe() I know the help page says 'numeric vector' but it would be kind of nice if it worked with numeric things of class array too. I think it would need no more than a couple of as.numeric() calls in thigmophobe itself, or (simpler but slightly less
2004 May 13
0
using trace() on S4 coerce method
I'm trying to use trace() on an S4 coerce method, but get the error Error in bindingIsLocked(what, whereM) : no binding for "coerce" What am I doing wrong? Example code follows. (I've googled the R mailing lists for "trace coerce" and "trace bindingisLocked" without finding anything relevant. Perhaps I should re-define the method in terms of an