Displaying 20 results from an estimated 8000 matches similar to: "refitting lm() with same x, different y"
2005 Apr 21
2
apply vs sapply vs loop - lm() call appl(y)ied on array
Christoph --
There was just a thread on this earlier this week. You can search in the
archives for the title: "refitting lm() with same x, different y".
(Actually, it doesn't turn up in the R site search yet, at least for me.
But if you just go to the archive of recent messages, available through
CRAN, you can search on refitting and find it. The original post was from
William
2005 Feb 25
1
anova grouping of factors in lme4 / lmer
Hi. I'm using lmer() from the lme4 package (version 0.8-3) and I can't get
anova() to group variables properly. I'm fitting the mixed model
Response ~ Weight + Experimenter + (1|SUBJECT.NAME) + (1|Date.StudyDay)
where Weight is numeric and Experimenter is a factor, ie,
> str(data.df)
`data.frame': 4266 obs. of 5 variables:
$ SUBJECT.NAME : Factor w/ 2133 levels
2007 Nov 14
1
test for existance of a method for given class
Dear All,
I want to test whether a method exists for given object. For example,
whether a function "deviance" is defined for an object of the "lm" class.
My imperfect understanding leads me to think something like
hasMethod("deviance", object)
hasMethod("deviance", "lm")
existsMethod("deviance", signature(class="lm"))
2007 Aug 02
1
simulate() and glm fits
Dear All,
I have been trying to simulate data from a fitted glm using the simulate()
function (version details at the bottom). This works for lm() fits and
even for lmer() fits (in lme4). However, for glm() fits its output does
not make sense to me -- am I missing something or is this a bug?
Consider the following count data, modelled as gaussian, poisson and
binomial responses:
counts
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
2005 May 17
1
setting value arg of pdSymm() in nlme
Dear All,
I wish to model random effects that have known between-group covariance
structure using the lme() function from library nlme. However, I have yet
to get even a simple example to work. No doubt this is because I am
confusing my syntax, but I would appreciate any guidance as to how. I have
studied Pinheiro & Bates carefully (though it's always possible I've
missed
2007 May 15
3
qr.solve and lm
Dear R experts,
I have a Matlab code which I am translating to R in order to examine and
enhance it.
First of all, I need to reproduce in R the results which were already
obtained in Matlab (to make sure that everything is correct).
There are some matrix manipulations and '\' operation among them in the
code.
I have the following data frame
> ABS.df
Pro syn
1997 Oct 17
1
R-beta: more model.matrix
I am trying to show some techniques to my graduate regression class.
The textbook mentioned using bootstrap samples of regression
coefficients for assessing variability. I decided to show them
reasonably effective ways of doing the resampling.
The following is a function I wrote to create bootstrap samples of
coefficients from a fitted linear regression model.
bsCoefSample <-
##
2003 Jun 26
3
lm diagnostics and qr (fwd)
I have been struggling to find some informaation on what lm exactly does.
I know it uses the QR decomp. However, I was recently faced with a
somewhat badly scaled matrix and summary(lm) said
Coefficients: ( 4 not defined because of singularities)
does anyone know how lm chooses these 4 coef. is it forward building of
the model --> drop last when qr sends a non full rank design matrix?
My
2005 Apr 13
1
lm() with many responses
Hi all,
I have one array of predictors, one observation per row, and one array
of responses, also arranged one observation per row. I arrange these
into a data.frame and call lm() with a pasted-together formula.
I would like to call lm() with a number of responses in excess of 100,
but for some reason, 39 seems to be a limit. Why do I get an "invalid
variable names" error from
2001 Jul 08
1
predict.lm(...., se=T), with 1-column model matrix (PR#1018)
# r-bugs@r-project.org
The problem occurs when the model matrix has a single
column.
> elastic <- data.frame(stretch=c(46,54,48,50,44,42,52),
distance=c(183,217,189,208,178,150,249))
> elastic.lm <- lm(distance ~ -1 + stretch, data=elastic)
> predict(elastic.lm,se=T)
Error in XRinv^2 %*% rep(res.var, p) : non-conformable arguments
The fix is to replace
XRinv <-
2004 Mar 05
1
row-echelon form (was no subject)
I think one needs an LU decomposition rather than QR.
However, I couldn't find anything off the shelf to do
an LU, other than learning that determinant() now
uses LU instead of QR or SVD, so the code to do it must
be in there for those that want it.
You'll probably need to divide rows of U by the first
entry if you insist on the unique reduced REF.
However, I can't see any reason
2007 Dec 06
1
lm.influence under R2.6.1
Greetings!
Recently when I tried to use lm.influence I get the following error:
Error in .Fortran("lminfl", model$qr$qr, n, n, k, as.integer(do.coef), :
Fortran symbol name "lminfl" not in DLL for package "base"
This occurs on both Linux and Windows platforms (details below).
Searching the mail lists and other sources indicates that the fortran code
for
2005 Oct 20
0
survreg anova: problem with indirect invocation
Dear R help,
I've encountered a problem with survreg's anova(). I am currently
writing general code to fit a variety of models using different fitting
functions. Here's a simple example of what I'm trying to do:
---begin code---
# general function to analyse data
analyse.data <- function(formula, FUN, data, ...)
{
fit <- FUN(formula, data=data, ...)
anova(fit)
2007 May 01
1
(PR#9623) qr.coef: permutes dimnames; inserts NA; promises
On Thu, 19 Apr 2007, brech at delphioutpost.com wrote:
> Full_Name: Christian Brechbuehler
> Version: 2.4.1 Patched (2007-03-25 r40917)
> OS: Linux 2.6.15-27-adm64-xeon; Ubuntu 6.06.1 LTS
> Submission from: (NULL) (24.61.47.236)
>
>
> Splus and R have different ideas about what qr.coef(qr()) should return,
> which is fine... but I believe that R has a bug in that it is not
2007 May 15
2
QR Decompositon and qr.qty
Dear R people,
I do not have much knowledge about linear algebra but currently I need
to understand what the function qr.qty is actually doing. The
documentation states that it calculates t(Q) %*% y via a previously
performed QR matrix decomposition.
In order to do that, I tried following basic example:
m<-matrix(c(1,0,0,0,1,0,0,0,1,0,0,1),ncol=3) # 4x3 matrix
2012 Sep 07
1
Suggest adding a 'pivot' argument to qr.R
I suggest adding a 'pivot' argument to qr.R, to obtain columns in the
same order as the original x, so that
a <- qr(x)
qr.Q(a) %*% qr.R(a, pivot=TRUE)
returns x.
--------------------------------------------------
# File src/library/base/R/qr.R
qr.R <- function(qr, complete = FALSE, pivot = FALSE)
{
# Args:
# qr: a QR decomposition, produced by qr()
# complete:
2009 Apr 27
2
refit with binomial model (lme4)
Dear R users,
I'm trying to use function 'refit' from lme4
and I get this error that I can't understand:
> refit(dolo4.model4,cbind(uu,50-uu))
Error in function (classes, fdef, mtable) :
unable to find an inherited method for function "refit", for signature
"mer", "matrix"
if I try:
> refit(dolo4.model4,uu)
Error in asMethod(object) :
2007 Dec 14
2
train nnet
Hi R-helpers,
Can some one tell me how to train 'mynn' of this type?:
mynn <- nnet(y ~ x1 + ..+ x8, data = lgist, size = 2, rang = 0.1,
decay = 5e-4, maxit = 200)
I assume that this nn is untrained, and to train I have to split the
original data into train:test data set,
do leave-one-out refitting to refine the weights (please straighten
this up if I was wrong).
I just don't know
2018 Jan 23
1
Inconsistent rank in qr()
Le 23/01/2018 ? 08:47, Martin Maechler a ?crit?:
>>>>>> Serguei Sokol <sokol at insa-toulouse.fr>
>>>>>> on Mon, 22 Jan 2018 17:57:47 +0100 writes:
> > Le 22/01/2018 ? 17:40, Keith O'Hara a ?crit?:
> >> This behavior is noted in the qr documentation, no?
> >>
> >> rank - the rank of x as