Displaying 20 results from an estimated 3000 matches similar to: "singular.ok in lm"
2009 Jul 03
2
Two questions about the cloud function in the lattice package
Hi,
I have two questions regarding the cloud function in the lattice
package:
1) Is there a way to not print the surrounding frame (i.e. the square
surrounding the entire plot)?
2) Is there a way to italicize the text displayed with the key argument?
Some sample code:
data(iris)
cloud(Sepal.Length~Petal.Length*Petal.Width,data=iris,
groups=Species,screen=list(z=20,x=-70),
2008 Dec 04
1
Changing 'record' option in open graphics device
Hi,
I am wondering if there is a way to change the value of the "record" option
in a graphics device that is already open (and accepts this option). I
don''t want to open a new device with, for example "dev.new(record=T)", but
just want to change the settings of the current device. This can be done by
pointing and clicking on the "history" tab of a
2010 Sep 22
1
Newey West and Singular Matrix
dear R experts: ?I am writing my own little newey-west standard error
function, with heteroskedasticity and arbitrary x period
autocorrelation corrections. ?including my function in this post here
may help others searching for something similar. it is working quite
well, except on occasion, it complains that
Error in solve.default(crossprod(x.na.omitted, x.na.omitted)) :
system is
2011 Aug 16
2
generalized inverse using matinv (Design)
i am trying to use matinv from the Design package
to compute the generalized inverse of the normal equations
of a 3x3 design via the sweep operator.
That is, for the linear model
y = ? + x1 + x2 + x1*x2
where x1, x2 are 3-level factors and dummy coding is being used
the matrix to be inverted is
X'X =
9 3 3 3 3 3 3 1 1 1 1 1 1 1 1 1
3 3 0 0 1 1 1 1 0 0 1 0 0 1 0 0
3 0 3 0 1 1 1 0 1 0 0 1
2010 Sep 23
1
Newey West and Singular Matrix + library(sandwich)
thank you, achim. I will try chol2inv.
sandwich is a very nice package, but let me make some short
suggestions. I am not a good econometrician, so I do not know what
prewhitening is, and the vignette did not explain it. "?coeftest" did
not work after I loaded the library. automatic bandwidth selection
can be a good thing, but is not always.
as to my own little function, I like the
2007 May 19
1
clustered standarderrors using design package
Please help,
I have a strange problem. I've got a balanced panel data set. I use dummy
variable regression and I've got results with lm function.
summary(lm(y ~ post + t19961 + t19962 + t19963 + t19964 + t19971 + t19972
+ t19973 + t19974 + t19981+factor( id)))
The problem is that I would like to get my standard errors clustered but
then gets the following error message:
f<-(lm(y ~
2005 Nov 21
1
singular convergence with lmer function i lme4
Dear R users,
I am trying to fit a GLMM to the following dataset;
tab
a b c
1 1 0.6 199320100313
2 1 0.8 199427100412
3 1 0.8 199427202112
4 1 0.2 199428100611
5 1 1.0 199428101011
6 1 0.8 199428101111
7 0 0.8 199527103011
8 1 0.6 199527200711
9 0 0.8 199527202411
10 0 0.6 199529100412
11 1 0.2 199626201111
12 2 0.8 199627200612
13 1 0.4 199628100111
14 1 0.8
2008 May 15
0
weights in GAM
I have a problem finding how to use prior.weights or weights options when
performing a stepwise GAM analysis (gam and step.gam functions) for
covariate inclusions.
Thanks beforehand for references or help on how to handle these 2 options.
--
Paul Baverel, MSc,
PhD student
Div. of Pharmacokinetics and Drug Therapy,
Dept. of Pharmaceutical Biosciences,
Faculty of Pharmacy
Uppsala University
Box
2005 Aug 18
1
Error messages using LMER
Dear All,
After playing with lmer for couple of days, I have to say that I am
amazed! I've been using quite some multilevel/mixed modeling packages,
lme4 is a strong candidate for the overall winner, especially for
multilevel generzlized linear models.
Now go back to my two-level poisson model with cross-classified model.
I've been testing various different model specificatios for the
2013 Jan 18
1
Error in mer_finalize(ans) : Downdated X'X is not positive definite, 8.
Dear All,
I have conducted an experiment in order to examine predation pressure in the
surroundings of potential wildlife road-crossing structures. I have
documented predation occurrence (binary?) in these structures and calculated
several possible explanatory variables describing the spatial heterogeneity
in several scales. At the landscape scale I have calculated the percentage
of different
2004 Jan 12
1
question about how summary.lm works
Hi,
While exploring how summary.lm generated its output I came across a section
that left me puzzled.
at around line 57
R <- chol2inv(Qr$qr[p1, p1, drop = FALSE])
se <- sqrt(diag(R) * resvar)
I'm hoping somebody could explain the logic of these to steps or
alternatively point me in the direction of a text that will explain these
steps.
In particular I'm puzzled
2004 Feb 12
2
variances of values predicted using a lm object
Hi,
is there a function in R that will give me the variances of a
predicted values obtained using predict.lm().
If no function is available I would need to calculate them myself -
which involves taking the inverse of X'X (' indicating transpose)
where X is my model matrix. I know that calculating an inverse directly
is not a good idea in general - could anybody suggest a way around
2009 Oct 11
2
Why H1=1? (H's the hat matrix)
Suppose I have the following hat matrix:
H=X(X'X)^{-1}X'
X is a n by p matrix, where n >= p and X_{i,1} = 1
I'm wondering why H1 = 1. (Here, 1 is column vector, whose each
element is the number 1)
Thank you!
2010 Oct 26
1
lme vs. lmer results
Hello,
and sorry for asking a question without the data - hope it can still
be answered:
I've run two things on the same data:
# Using lme:
mix.lme <- lme(DV ~a+b+c+d+e+f+h+i, random = random = ~ e+f+h+i|
group, data = mydata)
# Using lmer
mix.lmer <- lmer(DV
~a+b+c+d+(1|group)+(e|group)+(f|group)+(h|group)+(i|group), data =
mydata)
lme provided an output (fixed effects and random
2006 Apr 24
1
Handling large dataset & dataframe [Broadcast]
Here's a skeletal example. Embellish as needed:
p <- 5
n <- 300
set.seed(1)
dat <- cbind(rnorm(n), matrix(runif(n * p), n, p))
write.table(dat, file="c:/temp/big.txt", row=FALSE, col=FALSE)
xtx <- matrix(0, p + 1, p + 1)
xty <- numeric(p + 1)
f <- file("c:/temp/big.txt", open="r")
for (i in 1:3) {
x <- matrix(scan(f, nlines=100), 100,
2000 Mar 20
3
lm handling of ill-conditioned systems
The lm() function in R seems to handle the inversion of singular X'X matrices
(where there is collinearity between regression inputs) in a way
where one of the inputs is dropped and this also seems to be the
default behavior in SAS (please let me know if i'm wrong about this).
In some other packages (i.e. octave ols() function) the pseudo
inverse is computed where singular values less
2009 Nov 08
2
influence.measures(stats): hatvalues(model, ...)
Hello:
I am trying to understand the method 'hatvalues(...)', which returns something similar to the diagonals of the plain vanilla hat matrix [X(X'X)^(-1)X'], but not quite.
A Fortran programmer I am not, but tracing through the code it looks like perhaps some sort of correction based on the notion of 'leave-one-out' variance is being applied.
Whatever the
2000 Mar 21
3
buggy eigen function
It was a real surprise, but a student in my class found that the
function eigen is buggy. He traced to the problem from his inability
of getting principal component analysis to work on his data.
Chong Gu
Here is a matrix I generated through X'X, where X is 2x3.
> jj
[,1] [,2] [,3]
[1,] 0.8288469 -1.269783 -0.7533517
[2,] -1.2697829 2.162132 2.0262917
[3,]
2006 Sep 12
2
(no subject)
Hi,
I have a problem with aggregate.
x <- aggregate(t1,list(t2,t3,t4), mean)
z<-x[,3]
I want z to be a vector but it is a factor.
I've tried to use as.vector(z,mode="numeric") but then the numbers get
scrambeled.
Any help is appriciated
/anders
2006 Nov 05
2
solution to a regression with multiple independent variable
Please forgive a statistics question.
I know that a simple bivariate linear regression, y=f(x) or in R
parlance lm(y~x) can be solved using the variance-covariance matrix:
beta(x)=covariance(x,y)/variance(x). I also know that a linear
regression with multiple independent variables, for example y=f(x,z)
can also be solved using the variance-covariance matrix, but I don't
know how to do this.