Displaying 20 results from an estimated 300 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
2024 Sep 04
2
Calculation of VCV matrix of estimated coefficient
Hi,
I am trying to replicate the R's result for VCV matrix of estimated
coefficients from linear model as below
data(mtcars)
model <- lm(mpg~disp+hp, data=mtcars)
model_summ <-summary(model)
MSE = mean(model_summ$residuals^2)
vcov(model)
Now I want to calculate the same thing manually,
library(dplyr)
X = as.matrix(mtcars[, c('disp', 'hp')] %>% mutate(Intercept =
2024 Sep 05
1
Calculation of VCV matrix of estimated coefficient
sigma(model)^2 will give the correct MSE. Also note that your model
matrix has intercept at
the end whereas vcov will have it at the beginning so you will need to
permute the rows
and columns to get them to be the same/
On Wed, Sep 4, 2024 at 3:34?PM Daniel Lobo <danielobo9976 at gmail.com> wrote:
>
> Hi,
>
> I am trying to replicate the R's result for VCV matrix of
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
2024 Dec 24
1
Extract estimate of error variance from glm() object
I think vcov() gives estimates of VCV for coefficients.
I want estimate of SD for residuals
On Tue, Dec 24, 2024 at 7:24?PM Ben Bolker <bbolker at gmail.com> wrote:
>
> vcov(). ?
>
>
> On Tue, Dec 24, 2024, 8:45 AM Christofer Bogaso <bogaso.christofer at gmail.com> wrote:
>>
>> Hi,
>>
>> I have below GLM fit
>>
>> clotting <-
2024 Dec 24
1
Extract estimate of error variance from glm() object
?deviance ?anova
Bert
On Tue, Dec 24, 2024 at 6:22?AM Christofer Bogaso
<bogaso.christofer at gmail.com> wrote:
>
> I think vcov() gives estimates of VCV for coefficients.
>
> I want estimate of SD for residuals
>
> On Tue, Dec 24, 2024 at 7:24?PM Ben Bolker <bbolker at gmail.com> wrote:
> >
> > vcov(). ?
> >
> >
> > On Tue, Dec 24,
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
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
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
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 <-
2024 Sep 03
0
How R calculates SE of prediction for Logistic regression?
Hi,
I have below logistic regression
Dat =
read.csv('https://raw.githubusercontent.com/sam16tyagi/Machine-Learning-techniques-in-python/master/logistic%20regression%20dataset-Social_Network_Ads.csv')
head(Dat)
Model = glm(Purchased ~ Gender, data = Dat, family = binomial())
How I can get Standard deviation of forecasts as
head(predict(Model, type="response", se.fit =
2024 Dec 24
1
Extract estimate of error variance from glm() object
vcov(). ?
On Tue, Dec 24, 2024, 8:45 AM Christofer Bogaso <bogaso.christofer at gmail.com>
wrote:
> Hi,
>
> I have below GLM fit
>
> clotting <- data.frame(
> u = c(5,10,15,20,30,40,60,80,100),
> lot1 = c(118,58,42,35,27,25,21,19,18),
> lot2 = c(69,35,26,21,18,16,13,12,12))
> summary(glm(lot1 ~ log(u), data = clotting, family = gaussian))
>
>
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