Displaying 20 results from an estimated 30000 matches similar to: "Newly installed version; can't run lm function"
2017 Dec 19
1
lm considers removed predictors when finding complete cases
Dear R-devel list,
I realized that removing a predictor in lm through the "-"'s operator in
formula() does not affect the complete cases that are considered. A minimal
example is:
summary(lm(Wind ~ ., data = airquality))
# 42 observations deleted due to missingness
summary(lm(Wind ~ . - Ozone, data = airquality))
# still 42 observations deleted due to missingness, even if only 7
2017 Jun 21
0
selecting dataframe columns based on substring of col name(s)
> On Jun 21, 2017, at 9:11 AM, Evan Cooch <evan.cooch at gmail.com> wrote:
>
> Suppose I have the following sort of dataframe, where each column name has a common structure: prefix, followed by a number (for this example, col1, col2, col3 and col4):
>
> d = data.frame( col1=runif(10), col2=runif(10), col3=runif(10),col4=runif(10))
>
> What I haven't been able to
2007 Oct 09
2
Help with gamm errors
Dear All
Hopefully someone out there can point out what I am missing! I have a
(large, several hundred) dataset of gardens in which over two years the
presence/absence of a particular bird species is noted each week. I have
good reason to believe there is a difference between the two years in the
weekly proportion of gardens and would like to assess this, before going on
to look in more detail at
2011 Dec 23
2
cast in reshape and reshape2
> library(reshape2)
> x = melt(airquality, id=c('month', 'day'))
With reshape I can cast with multiple functions:
> library(reshape)
> cast(x, month+variable~., c(mean,sd))
month variable mean sd
1 5 ozone 23.615385 22.224449
2 5 solar.r 181.296296 115.075499
3 5 wind 11.622581 3.531450
4 5 temp 65.548387
2011 Feb 02
1
update not working
R-help,
I'm using the "update" command for a multiple regression model and it is
just not working:
> update(model1, . ~ . – temp:wind:rad,data=ozone.pollution)
Error: unexpected input in "model2<-update(model1, . ~ . –"
> summary(model1)
Call:
lm(formula = ozone ~ temp * wind * rad + I(rad^2) + I(temp^2) +
I(wind^2), data = ozone.pollution)
Residuals:
2007 Aug 28
1
subcripts on data frames (PR#9885)
I'm not sure if this is a bug, or if I'm doing something wrong.
=20
=46rom the worms dataframe, which is at in a file called worms.txt at
=20
http://www.imperial.ac.uk/bio/research/crawley/therbook
<http://www.imperial.ac.uk/bio/research/mjcraw/therbook/index.htm>=20
=20
the idea is to extract a subset of the rows, sorted in declining order
of worm density, with only the maximum
2013 Nov 04
1
Subject: Regress multiple independent variables on multiple dependent variables
I want to estimate the effect of several independent variables on several
dependent
variables. In the example below I wanted to estimate the
effect of three independent variables on ozone and temperature. My aim is
to create a list of dependent and independent variables and automate the
process rather than writing every dependent and independent variable in
each model as I have done below.
2013 Feb 17
3
Select components of a list
Hi Gustav,
Try this:
lapply(1:length(models),function(i) lapply(models[[i]],function(x) summary(x)$coef[2,]))[[1]] #1st list component
[[1]]
#??? Estimate?? Std. Error????? z value???? Pr(>|z|) # pm10
#5.999185e-04 1.486195e-04 4.036606e+00 5.423004e-05
#[[2]]
#??? Estimate?? Std. Error????? z value???? Pr(>|z|) #ozone
#0.0010117294 0.0003792739 2.6675428048 0.0076408155
#[[3]]
#???
2008 Mar 24
2
Newbie help with Sweave
I think I've gotten my Emacs/Sweave/R system set up correctly, thanks to
Vincent and Jim, but I haven't been successful getting my first document
produced. I'm trying to use one of Friedrich Leisch's examples,
http://www.ci.tuwien.ac.at/~leisch/Sweave/example-1.Snw. I cut and
pasted the text into a document sweaveexample.Rnw in Emacs. It seemed to
be processed successfully with R:
2007 Sep 16
1
Identifying objects from a data set
Hello
Given the following data for a data set called airquality. To identify the nature of the objects from the data set airquality example "Ozone" would it be best to use the command is. like is.character(airquality$Ozone) ....... I tried attributes(airquality$Ozone) but it came up null. Would there be a better way to identify these objects.
Thanking you in advance for your
2013 Nov 07
1
problem with interaction in lmer even after creating an "interaction variable"
Dear all,
I have a problem with interactions in lmer. I have 2 factors (garden and
gebiet) which interact, plus one other variable (home), dataframe arr. When
I put:
/
lmer (biomass ~ home + garden:gebiet + ( 1|Block), data = arr)/
it writes:
/Error in lme4::lFormula(formula = biomass ~ home + garden:gebiet + (1 | :
rank of X = 28 < ncol(X) = 30/
In the lmer help I found out that if not
2010 Dec 26
1
Question about mars() -function
Hi!
I have some questions about MARS model's coefficient of determination.
I use the MARS method in my master's thesis and I have noticed some
problems with
the MARS model's R^2.
You can see the following example that the MARS model's R^2 is too big
when i have used mars() -function for MARS model building, and when I
have made MARS-model using a linear regression, it
2017 Jun 26
2
Odd behaviour in within.list() when deleting 2+ variables
>>>>> peter dalgaard <pdalgd at gmail.com>
>>>>> on Mon, 26 Jun 2017 13:43:28 +0200 writes:
> This seems to be due to changes made by Martin Maechler in
> 2008. Presumably this fixed something, but it escapes my
> memory.
Yes: The change set (svn -c46441) also contains the following NEWS entry
BUG FIXES
o
2009 May 29
1
data manipulation involving aggregate
hi all,
I often have a data frame like this example
data.frame(sq=c(1,1,1,2,2,3,3,3,3),area=c(1,2,3,1,2,3,1,2,3),habitat=c("garden","garden","pond","field","garden","river","garden","field","field"))
for each "sq" I have multiple "habitat"s each with an associated "area".
I
2005 Dec 05
1
need help with matrix manipulation
I hope my problem is not too basic to post here. I am a beginner having
problems with some matrix manipulation. The data I am working with are
sites with hourly ozone readings and is in a matrix where each row is a site
and each column is an hourly reading. So for 10 sites, one day's worth of
data is a 10x24 matrix - column 1 is the ozone measurement for midnight GMT,
column 2 is ozone at
2018 Dec 12
2
Subset dentro de un for
Gracias a los tres, Raúl, Marcelino y Carlos.
Lo del "get" de Marcelino me da la respuesta a lo que yo exactamente
preguntaba, y funciona, pero ahora tengo problemas con el for, por lo
que probablemente recurra al eval parse de Raúl o Carlos, que ya
tienen el for. Aún así, lo intento 1º con el get.
Con subset(df, subset=get(GT[i])>0) el problema es que en el for hago
un
2009 Oct 17
2
ozone data
Hi just a quick inquiry
Sorry if this is too trivial but I am just a beginner in R.
I am looking at the plyr package and I am intrigued at how data(i.e. ozone, baseball) is loaded without having to type data(ozone). Are they automatically loaded when i call library(plyr)? I want to do the same thing when I make my package. How does one accomplish this?
Also, are there any beginner guides on how
2018 Dec 12
2
Subset dentro de un for
Gracias Marcelino. Si, (i in 1:length(GT)), lo he utilizado mil veces,
pero se me sigue olvidando de una vez a otra. Lo iba a mirar, pero me
centré primero en que me hiciera bien el mapa.
He probado el for y me da este error:
Error in aes(x = lon, y = lat, color = get(GT[i]), size = 2) +
scale_colour_gradient(low = ("white"), :
non-numeric argument to binary operator
2004 Apr 06
1
k nearest neighbours
I want to
1) Select for each of the n points in a matrix A, those of the m points
in B that lay within a given radius.
2) Of those points within the radius, select the k nearest ones.
What I now do is
1) Create an n*m matrix C were I put the distances from all the points
in B to the points in A and make NA those cells were the distance is
larger than the radius. (The points are geographical
2008 Feb 12
3
fun.aggregate=mean in reshape
Hi all,
We are facing a problem while introducing ourselves to Reshape package
use. Melt seems to work fine, but cast fails when we use mean as
fun.aggregate. As you see here, length and sum work fine, but mean
throws this same error whatever dataset we use.
> cast(aqm, month ~ variable, length)
month ozone solar.r wind temp
1 5 26 27 31 31
2 6 9 30 30