Displaying 20 results from an estimated 20000 matches similar to: "lm() with many responses"
1999 Oct 25
2
leaps: XHAUST returned error code -999
Hi there,
This problem has been dogging me for a bit, and I'm trying to
figure out why. When running the the subsets function in the leaps
library, R is giving me the following error message
> lvodsub <- subsets(pred, resp$LVOD)
Warning message:
XHAUST returned error code -999 in: leaps.exhaustive(a, really.big =
really.big)
but this still happens if I add the really.big option:
2003 Oct 30
2
'nls' and its arguments
Dear R experts!
I'd to fit data by 'nls' with me-supplied function 'fcn'.
1) I'd like 'fcn' to accept arbitrary arguments, i.e. I defined it
as f(...) {<body>}. (Ok, that's not actually impotant).
2) Second, I would NOT like to supply every parameter in the formula.
To illustrate this, let's look at the last example of 'nls' help
2006 Mar 05
1
predicted values in mgcv gam
Hi,
In fitting GAMs to assess environmental preferences, I use the part
of the fit where the lower confidence interval is above zero as my
criterion for positive association between the environmental variable
and species abundance. However I like to plot this on the original
scale of species abundance. To do so I extract the fit and SE using
predict.gam.
Lately I compared more
2006 Oct 08
1
Simulate p-value in lme4
Dear r-helpers,
Spencer Graves and Manual Morales proposed the following methods to
simulate p-values in lme4:
************preliminary************
require(lme4)
require(MASS)
summary(glm(y ~ lbase*trt + lage + V4, family = poisson, data =
epil), cor = FALSE)
epil2 <- epil[epil$period == 1, ]
epil2["period"] <- rep(0, 59); epil2["y"] <- epil2["base"]
2009 Jun 11
1
Restrict AIC comparison to succesful models?
Hello list,
I'm doing a bootstrap analysis where some models occasionally fail to
converge. I'd like to automate the process of restricting AIC to the
models that do converge. A contrived example of what I'd like to do is
below:
resp <- c(1,1,2)
pred <- c(1,2,3)
m1 <- lm(resp~pred)
m2 <- lm(resp~poly(pred,2))
m3 <- lm(resp~poly(pred,3)) # Fails, obviously
## Some
2011 Oct 09
1
sapply(pred,cor,y=resp)
Hello. I am wondering why I am getting NA for all in cors=sapply(pred,cor,y=resp). I suppose that each column in pred has NAs in them. Is there some way to fix this? Thanks
> str(pred)
'data.frame': 200 obs. of 13 variables:
$ mnO2: num 9.8 8 11.4 4.8 9 13.1 10.3 10.6 3.4 9.9 ...
$ Cl : num 60.8 57.8 40 77.4 55.4 ...
$ NO3 : num 6.24 1.29 5.33 2.3 10.42 ...
$ NH4 : num 578
2009 Nov 29
1
Plotting observed vs. fitted values
Dear Wiza[R]ds,
I am very grateful to Duncan Murdoch for his assistance with this problem.
His help was invaluable. However, the problem has become a little more
complicated for me. Now, in each plot, I need to plot the observed and
fitted values of a supine and upright posture experiment. Here is what I
have and how far I got.
# tritiated (3H)-Norepinephrine(NE) disappearance from plasma
#
2009 Nov 28
1
Plot fitted vs observed values
Dear Wiza[R]ds,
# I have the following experimentally observed data:
csdata <- data.frame(
time=c(0,1,3,9,20),
conc=c(638.697,395.69,199.00,141.58,112.16)
)
# weighting resp means response
wt.MM<- function(resp, time,A1,a1,A2,a2)
{
pred <- A1*exp(-a1*time)+A2*exp(-a2*time)
(resp - pred) / sqrt(pred)
}
# Fit using nls
cs.wt <- nls( ~ wt.MM(conc, time,A1,a1,A2,a2),
2009 Nov 29
3
Plotting observed vs. Predicted values, change of symbols
Dear Wiz[R]ds,
I am deeply grateful for the help from Duncan Murdoch, Gray Calhoun, and
others. We are almost there. For whatever reason, I can't change the symbol
from a circle to a triangle in the upright posture plots. Any ideas? I have
included the problem in full.
# tritiated (3H)-Norepinephrine(NE) disappearance from plasma
# concentrations supine and upright
# supine
datasu <-
2006 Aug 17
1
Simulate p-value in lme4
Dear list,
This is more of a stats question than an R question per se. First, I
realize there has been a lot of discussion about the problems with
estimating P-values from F-ratios for mixed-effects models in lme4.
Using mcmcsamp() seems like a great alternative for evaluating the
significance of individual coefficients, but not for groups of
coefficients as might occur in an experimental design
2003 May 22
1
Plot observed vs. fitted values (weighted nls)
Dear WizaRds,
Given the experimental data,
csdata<-data.frame(
time=c(0,1,3,9,20),
conc=c(638.697,395.69,199.00,141.58,112.16)
)
weighted nls is applied,
wt.MM<- function(resp, time,A1,a1,A2,a2)
{
pred <- A1*exp(-a1*time)+A2*exp(-a2*time)
(resp - pred) / sqrt(pred)
}
#
cs.wt <- nls( ~ wt.MM(conc, time,A1,a1,A2,a2), data=csdata,
2007 Feb 20
1
text.rpart for the "class" method doesn't act on label="yprob"
Hello All,
Am I misreading the documentation?
The text.rpart documentation says:
"label a column name of x$frame; values of this will label the nodes. For
the "class" method, label="yval" results in the factor levels being
used, "yprob" results in the probability of the winning factor level being
used, and ?specific yval level? results in the probability of
2003 Jul 16
2
Is there a bug in qr(..,LAPACK=T)
The following snippet suggests that there is either a bug in qr(,LAPACK=T), or some bug in my understanding. Note that the detected rank is correct (= 2) using the default LINPACK qr, but incorrect (=3) using LAPACK. This is running on Linux Redhat 9.0, using the lapack library that comes with the Redhat distribution. I'm running R 1.7.1 compiled from the source. If the bug is in my
2009 Jun 17
3
Matrix inversion-different answers from LAPACK and LINPACK
Hello.
I am trying to invert a matrix, and I am finding that I can get different
answers depending on whether I set LAPACK true or false using "qr". I had
understood that LAPACK is, in general more robust and faster than LINPACK,
so I am confused as to why I am getting what seems to be invalid answers.
The matrix is ostensibly the Hessian for a function I am optimizing. I want
to get
2012 Apr 26
2
How does .Fortran "dqrls" work?
Hi, all.
I want to write some functions like glm() so i studied it.
In glm.fit(), it calls a fortran subroutine named "dqrfit" to compute least
squares solutions
to the system
x * b = y
To learn how "dqrfit" works, I just follow how glm() calls "dqrfit" by my
own example, my codes are given below:
> qr <-
>
2002 Aug 07
2
Constructing titles from list of expressions
Hello!
I have the following problem:
I have a function to construct three surfaceplots with a marker for an optimum,
each of the plots has as title paste("Estimated ",pred.var.lab," for
",var.lab[1]," vs. ",var.lab[2],sep="") with different var.lab[1,2] each time.
My problem is now that I need to allow for plotmath expressions in the
variables pred.var.lab
2000 Mar 01
1
"is.qr" definition (PR#465)
Might it be possible to tighten the definition of "is.qr". I
noticed that after I mistakenly typed
example(lm) # make lm object named lm.D9
qr.Q(lm.D9)
which exhausted the heap memory and produced two warning
messages. As an object of class "lm" has a "qr" component,
"is.qr" failed to detect that "lm.D9" was not a "qr" object. The
2006 Aug 31
1
NaN when using dffits, stemming from lm.influence call
Hi all
I'm getting a NaN returned on using dffits, as explained
below. To me, there seems no obvious (or non-obvious reason
for that matter) reason why a NaN appears.
Before I start digging further, can anyone see why dffits
might be failing? Is there a problem with the data?
Consider:
# Load data
dep <-
2016 Oct 24
3
typo or stale info in qr man
man for `qr` says that the function uses LINPACK's DQRDC, while it in
fact uses DQRDC2.
```
The QR decomposition of the matrix as computed by LINPACK or LAPACK.
The components in the returned value correspond directly to the values
returned by DQRDC/DGEQP3/ZGEQP3
```
2006 Apr 04
2
documenting s4 methods in package
Hi,
I have written a package that contains many s4 generic functions and
associated methods. I am having a lot of trouble getting R to build the help
pages for these generic functions without reporting, "missing link(s):
~~fun~~, which means that it cannot find the appropriate function when code
in the example section of the help is run. Right?
After some playing around I can get it to