Displaying 20 results from an estimated 2000 matches similar to: "filtering in aggregate"
2010 Dec 17
2
newbie question on str output
Hi!
Here is some output from an str command:
> str(CO2)
Classes ‘nfnGroupedData’, ‘nfGroupedData’, ‘groupedData’ and
'data.frame': 84 obs. of 5 variables:
$ Plant : Ord.factor w/ 12 levels "Qn1"<"Qn2"<"Qn3"<..: 1 1 1 1 1 1 1 2
2 2 ...
$ Type : Factor w/ 2 levels "Quebec","Mississippi": 1 1 1 1 1 1 1 1 1 1
...
$
2010 May 07
4
Any way to apply TWO functions with tapply()?
I need to compute the mean and the standard deviation of a data set and would
like to have the results in one table/data frame. I call tapply() two times
and do then merge the resulting tables to have them all in one table. Is
there any way to tell tapply() to use the functions mean and sd within one
function call? Something like tapply(data$response, list(data$targets,
data$conditions), c(mean,
2017 Oct 08
2
Manipulations with CO2 dataset on R
Hi,
I just started a new course this semester on R, I never used it in my life and i'm stuck on these questions from 3 days, it would be really nice if someone could explain me the answers with the relative commands.
thanks a lot in advance
The following 7 questions are based on the CO2 dataset of R.
1) How many of the plants in CO2 are Mc2 for Plant?
2) How many are either Mc2 or Mn2?
2007 Jul 16
5
formula(CO2)
The formula attribute of the builtin CO2 dataset seems a bit strange:
> formula(CO2)
Plant ~ Type + Treatment + conc + uptake
What is one supposed to do with that? Certainly its not suitable for
input to lm and none of the examples in ?CO2 use the above.
2009 Jun 15
4
books on Time series
Dear list fellows,
I want to study time series and use R to analyse time series of fishing
data from several species (landings and cpue) investigating the
correlation between them and with environmental factors (water
temperature, wind, etc.).
Searching at Amazon I found three books with examples in R:
Time Series Analysis: With Applications in R by Jonathan D. Cryer and
Jonathan D. Cryer
2007 Jun 04
3
test for nested factors
Is there a conventional way to test for nested factors? I.e., if 'a'
and 'b' are lists of same-length factors, does each level specified by
'a' correspond to exactly one level specified by 'b'?
The function below seems to suffice, but I'd be happy to know of a more
succinct solution, if it already exists.
Thanks,
Tim.
---
"%nested.in%" <-
2010 Jul 23
2
re-ordering bwplot
Dear list:
I'm using bwplot to compare concentrations by location and treatment as in:
# using built in data
bwplot( conc ~ Type : Treatment, data = CO2 )
I would like the order of the plots to be: 3,4,1,2. I can't seem to figure this out with index.cond or permc.cond.
Any help is appreciated!
Brad Eck
[[alternative HTML version deleted]]
2012 Oct 22
3
Error: object 'CO2' not found
Hello:
I am new on R, this is the first time I work with it,
I am trying to run some R example to get learn of them,
but, I have a problem when running the example below:
http://stat.ethz.ch/R-manual/R-patched/library/datasets/html/zCO2.html
CO2.Qn1 <- CO2[CO2$Plant == "Qn1", ]
SSasympOff(CO2.Qn1$conc, 32, -4, 43) # response only
Asym <- 32; lrc <- -4; c0 <- 43
2010 Aug 24
2
how do R calculates the number of intervals between tick-marks
Hello,
I want to know how do R calculates the number of intervals between
tick-marks in the y axis in a plot.
I'm making a three y-axes plot and this information would help me a lot.
Thanks in advance.
Antonio Olinto
----------------------------------------------------------------
Webmail - iBCMG Internet
http://www.ibcmg.com.br
2006 Aug 07
2
finding x values to meet a y
Hi,
I'd like to find which values of x will give me a y.
In other words, in the example of a gaussian curve, I want to find the values of
x that will give me a density, let's say, of 0.02.
curve(((1/(sqrt(2*pi)*10))*exp(-((x-50)^2)/(2*10^2))),xlim=c(0,100))
Thanks for any help,
Antonio Olinto
-------------------------------------------------
WebMail Bignet - O seu provedor do
2009 Mar 15
2
xyplot of a specific ID number
Dear R list members,
I have a question regarding xyplot. I managed to make a xyplot of all the
IDs by using the syntax below:
xyplot(PA ~ CRPC + CRPT | ID, data = redinteract)
Now, I'd like to make a graph of a specific ID number (e.g., only ID number
301). I thought I could use "subset", but it seems to be not working.
Could anyone let me know how I can make a graph of a
2009 Jun 11
1
formula for degrees of freedom for nonlinear mixed model in nlme
Dear forum members,
What is the formula to calculate denominator degrees of freedom (den df) for nonlinear mixed-effect models with covariates? My model is similar to a CO2 uptake example from Pinheiro and Bates (2000, page 376). In this CO2 dataset, there are two treatments and two types (84 observations in total), but den df for each parameter of the model is 64. Isn’t it too high?
Your
2013 Jul 01
2
Problem with anova and the new abbreviation restrictions
An unwanted side effect of the new restrictions on abrreviated names.
The anova.coxph command, in a slavish copy of anova.lm etc, returns a data frame with
column labels of
loglik Chisq Df Pr(>|Chi|)
If one tries to extract the final column of the table errors result since it is not a
standard R variable name.
> afit <- anova(lm(conc ~ uptake, CO2))
> afit$P
[1]
2011 Aug 20
1
Groups and bwplot
Dear R-users,
A while ago, Deepayan Sarkar suggested some code that uses the group
argument in bwplot to create some 'side-by-side' boxplots
(https://stat.ethz.ch/pipermail/r-help/2010-February/230065.html). The
example he gave was relatively specific and I wanted to generalize his
approach into a function. Unfortunately, I seem to have some issues
passing the correct arguments to the
2008 Dec 28
2
how to generalize the arguments for lm() (r-help@lists.R-project.org)
Hello,
How could I generalize the following statement for an arbitrary number of columns instead of 7?
result[[i]]<-lm( returns[,i] ~ factors[,1] + factors[,2] + factors[,3] + factors[,4] + factors[,5] + factors[,6] + factors[,7] )
Thank you,
Mathgurl
[[alternative HTML version deleted]]
2007 May 05
1
dynamically specifying regressors/RHS variables in a regression
Does anyone know if there is a way to specify regressors dynamically
rather than explicitly?
More specifically, I have a data set in "long format" that details a
number of individuals and their responses to a question (which can be
positive, negative, or no answer). Each individual answers as many
questions as they want, so there are a different number of rows per
individual.
For each
2006 Aug 10
2
index.cond in xyplot
Dear R-users
I have 5 dependent variables (y1 to y5) and one independent variable (x) and
3 conditioning variables (m, n, and 0). Each of the conditioning variables
has 2 levels. I created 2*4 panel plots.
xyplot(y1+y2+y3+y4+y5 ~ x | m*n*o,layout = c(4,2))
I would like to reorder the 8 panels. I tried to use index.cond (e.g.,
index.cond = list(c(1,3,2,4,5,7,6,8)) but it didn't work out.
2004 Apr 25
2
nonparametric multiple sample comparison
Hello all,
Here goes one of my first functions.
I want to make a nonparametric multiple sample comparison with unequal sample
sizes (see Zar?s Biostatistical Analysis, 3rd. Ed., pg. 201 Example 10.11, pg.
288 Example 11.10). In the real world, I want to compare samples of fish
length captured with different fishing gears.
After using the Kruskal-Wallis test I want to check the differences
2008 Apr 14
5
Equivalent to a BY command in SAS
Hi,
I'm very new to R and absolutely love it. Does anyone know how to use
something in R that functions like a BY command in SAS?
For example, let's say you have a variable x, and you want to see the mean.
Easy...
> mean(x)
But what if you want to see the mean of x conditional on another discrete
variable? My best attempts so far are something like...
> mean(x, y_cat=1)
2007 Jan 29
6
Loop with string variable AND customizable "summary" output
Dear All,
I am using R for my research and I have two questions about it:
1) is it possible to create a loop using a string, instead of a numeric vector? I have in mind a specific problem:
Suppose you have 2 countries: UK, and USA, one dependent (y) and one independent variable (y) for each country (vale a dire: yUK, xUK, yUSA, xUSA) and you want to run automatically the following regressions: