Displaying 20 results from an estimated 5000 matches similar to: "back tick names with predict function"
2023 Nov 30
1
back tick names with predict function
?s 17:38 de 30/11/2023, Robert Baer escreveu:
> I am having trouble using back ticks with the R extractor function
> 'predict' and an lm() model.? I'm trying too construct some nice vectors
> that can be used for plotting the two types of regression intervals.? I
> think it works with normal column heading names but it fails when I have
> "special"
2023 Dec 01
1
back tick names with predict function
Also, and possibly more constructively, when you get an error like
> CI.c = predict(mod2, data.frame( `plant-density` = x), interval = 'c') # fail
Error in eval(predvars, data, env) : object 'plant-density' not found
you should check your assumptions. Does "newdata" actually contain a columnn called "plant-density":
> head(data.frame( `plant-density`
2013 May 02
1
multivariate, hierarchical model
Sorry for the last email, sent too early.
I have a small data set that has a hierarchical structure. It has both temporal (year, months) and spatial (treatment code and zone code). The following explains the data:
WSZ_Code the
water supply zone code (1 to 8)
Treatment_Code the
treatment plant which supplies each water supply zone (1 to 4)
2023 Dec 01
1
back tick names with predict function
"Thank you Rui. I didn't know about the check.names = FALSE argument.
> Another good reminder to always read help, but I'm not sure I understood
> what help to read in this case"
?data.frame , of course, which says:
"check.names
logical. If TRUE then the names of the variables in the data frame are
checked to ensure that they are syntactically valid variable names
2012 May 04
1
sem error message
Hello, I tried to do a 'sem' analysis for data of how blueberry consumption
by birds is influenced by a pollution gradient, using distance and
vegetation structural and composition variables, but I got the following
error message:
Error in sem.default(ram = ram, S = S, N = N, param.names = pars, var.names
= vars, :
S must be a square triangular or symmetric matrix
This may be very
2007 Dec 11
4
EL5.1 client problems
Hi all,
I attempted to add an EL5.1 client to our puppet server (EL5), and after
signing the client cert, got the error "Certificates were not trusted:
hostname not match with the server certificate"
I found the mailing list discussion and the relevant page:
http://www.reductivelabs.com/trac/puppet/wiki/RubySSL-2007-006
As far as I can tell, my puppermaster''s cert CN matches
2012 Aug 22
3
Question concerning anova()
Hi
I am comparing four different linear mixed effect models, derived from updating the original one. To
compare these, I want to use anova(). I therefore do the following (not reproducible - just to
illustration purpose!):
dat <- loadSPECIES(SPECIES)
subs <- expression(dead==FALSE & recTreat==FALSE)
feff <- noBefore~pHarv*year # fixed effect in the model
reff <-
2010 Jan 28
2
Data.frame manipulation
Hi All,
I'm conducting a meta-analysis and have taken a data.frame with multiple
rows per
study (for each effect size) and performed a weighted average of effect size
for
each study. This results in a reduced # of rows. I am particularly
interested in
simply reducing the additional variables in the data.frame to the first row
of the
corresponding id variable. For example:
2010 Sep 26
1
formatting data for predict()
I'm trying to get predicted probabilities out of a regression model,
but am having trouble with the "newdata" option in the predict()
function. Suppose I have a model with two independent variables, like
this:
y=rbinom(100, 1, .3)
x1=rbinom(100, 1, .5)
x2=rnorm(100, 3, 2)
mod=glm(y ~ x1 + x2, family=binomial)
I can then get the predicted probabilities for the two values of
2012 Jun 06
3
Sobel's test for mediation and lme4/nlme
Hello,
Any advice or pointers for implementing Sobel's test for mediation in
2-level model setting? For fitting the hierarchical models, I am using
"lme4" but could also revert to "nlme" since it is a relatively simple
varying intercept model and they yield identical estimates. I apologize for
this is an R question with an embedded statistical question.
I noticed that a
2011 Oct 26
2
Error in summary.mlm: formula not subsettable
When I fit a multivariate linear model, and the formula is defined
outside the call to lm(), the method summary.mlm() fails.
This works well:
> y <- matrix(rnorm(20),nrow=10)
> x <- matrix(rnorm(10))
> mod1 <- lm(y~x)
> summary(mod1)
...
But this does not:
> f <- y~x
> mod2 <- lm(f)
> summary(mod2)
Error en object$call$formula[[2L]] <- object$terms[[2L]]
2010 Jul 09
1
output without quotes
Hi All,
I am interested in printing column names without quotes and am struggling to
do it properly. The tough part is that I am interested in using these column
names for a function within a function (e.g., lm() within a wrapper
function). Therefore, cat() doesnt seem appropriate and print() is not what
I need. Ideas?
# sample data
mod1 <- rnorm(20, 10, 2)
mod2 <- rnorm(20, 5, 1)
dat
2010 Feb 15
2
creating functions question
Hi All,
I am interested in creating a function that will take x number of lm
objects and automate the comparison of each model (using anova). Here
is a simple example (the actual function will involve more than what
Im presenting but is irrelevant for the example):
# sample data:
id<-rep(1:20)
n<-c(10,20,13,22,28,12,12,36,19,12,36,75,33,121,37,14,40,16,14,20)
2013 Mar 06
1
print justify
Hi everyone,
I'm trying to print a table justified to the left, but it doesn't work.
Any hints?
KennArt <- data.frame(NR=c(171,172,174,175,176,177,181,411,980), TYP=c("K?rnermais",
?"Corn Cob Mix", "Zuckermais", "Mischanbau (Silo)Mais/Sonnenblumen",
?"Mais mit Bejagungsschneise in gutem landwirtschaftlichen und ?kologischen Zustand",
2008 Oct 16
1
lmer for two models followed by anova to compare the two models
Dear Colleagues,
I run this model:
mod1 <- lmer(x~category+subcomp+category*subcomp+(1|id),data=impchiefsrm)
obtain this summary result:
Linear mixed-effects model fit by REML
Formula: x ~ category + subcomp + category * subcomp + (1 | id)
Data: impchiefsrm
AIC BIC logLik MLdeviance REMLdeviance
4102 4670 -1954 3665 3908
Random effects:
Groups Name Variance
2013 Nov 25
4
lmer specification for random effects: contradictory reults
Hi All,
I was wondering if someone could help me to solve this issue with lmer.
In order to understand the best mixed effects model to fit my data, I
compared the following options according to the procedures specified in many
papers (i.e. Baayen
<http://www.google.it/url?sa=t&rct=j&q=&esrc=s&source=web&cd=1&ved=0CDsQFjAA
2007 Jun 11
1
2 iosnoop scripts: different results
I am teaching a DTrace class and a student noticed that 2 iosnoop scripts run in two different windows were producing different results. I was not able to answer why this is. Can anyone explain this. Here are the reults from the two windows:
# io.d
...
sched 0 <none> 1024 dad1 W 0.156
bash 1998
2003 Feb 10
2
problems using lqs()
Dear List-members,
I found a strange behaviour in the lqs function.
Suppose I have the following data:
y <- c(7.6, 7.7, 4.3, 5.9, 5.0, 6.5, 8.3, 8.2, 13.2, 12.6, 10.4, 10.8,
13.1, 12.3, 10.4, 10.5, 7.7, 9.5, 12.0, 12.6, 13.6, 14.1, 13.5, 11.5,
12.0, 13.0, 14.1, 15.1)
x1 <- c(8.2, 7.6,, 4.6, 4.3, 5.9, 5.0, 6.5, 8.3, 10.1, 13.2, 12.6, 10.4,
10.8, 13.1, 13.3, 10.4, 10.5, 7.7, 10.0, 12.0,
2006 Dec 09
1
abline for intercept-only simple lm models (with and without offset)
The abline function can be used to draw the
regression line when one passes the lm object
as an argument.
However, if it's an intercept-only model,
it appears to use the intercept
as the slope of the abline:
mod <- lm(dist ~ 1, data = cars)
plot(dist ~ speed, data = cars)
abline(reg = mod) # nothing appears
This behaves as documented, but might catch
someone. Would it be an improvement
2009 Oct 21
1
How to find the interception point of two linear fitted model in R?
Dear All,
Let have 10 pair of observations, as shown below.
######################
x <- 1:10
y <- c(1,3,2,4,5,10,13,15,19,22)
plot(x,y)
######################
Two fitted? models, with ranges of [1,5] and [5,10],?can be easily fitted separately by lm function as shown below:
#######################
mod1 <- lm(y[1:5] ~ x[1:5])
mod2 <- lm(y[5:10] ~ x[5:10])
#######################