Displaying 16 results from an estimated 16 matches for "chickweight".
2012 Apr 12
1
Using dcast with multiple functions to aggregate
Dear R communitiy,
I am trying to use multiple functions for aggregation within a function
call for dcast. However this seems to result in an error. Also I have not
managed to make dcast() work with fun.aggregate=sd. Please find attached
some example code using the ChickWeight data.
Many thanks for your help!
Jokel
#Chick weight example
names(ChickWeight) <- tolower(names(ChickWeight))
sd(ChickWeight$weight) # works fine
mean(ChickWeight$weight) # works fine
length(ChickWeight$weight) # works fine
chick_m <- melt(ChickWeight, id=2:4, na.rm=TRUE)
dcast(ch...
2015 Apr 30
2
predict nlme
Estimado Oliver Nuñez
Envío un ejemplo reproducible.
Javier Marcuzzi
# de donde tomo datos, y tiene el modelo (en el pdf)
library(MCMCglmm)
# librería con las funciónes que voy a usar
library(nlme)
datos0<-ChickWeight
# creo algunos datos que agrego a los origonales
Factor<-as.numeric(datos0$Chick)
Factor[Factor > 0 & Factor <= 10] <- 'A'
Factor[Factor > 10 & Factor <= 20] <- 'B'
Factor[Factor > 20 & Factor <= 30] <- 'A'
Factor[Factor > 30 &a...
2010 Oct 01
2
Format of Output of Residuals
An excerpt from dataset ChickWeight:
??? weight Time Chick Diet
1?????? 42??? 0???? 1??? 1
2?????? 51??? 2???? 1??? 1
3?????? 59??? 4???? 1??? 1
I am interested in the residuals of the dataset.? Specifically in
saving them to another format. I have been creating text files with
sink.
CW.lm <- lm(weight ~ Diet, ChickWeight)
resid...
2009 Jul 06
2
ReShape chicks example - line plots
Hi,
In the examples from the ReShape package there is a simple example
of using melt followed by cast that produces a smallish amount of
output about the chicks database. Here's the code:
library(reshape)
names(ChickWeight) <- tolower(names(ChickWeight))
chick_m <- melt(ChickWeight, id=2:4, na.rm=TRUE)
DietResults <- cast(chick_m, diet + chick ~ time)
DietResults
My challenge is to extract an plot only a portion of this data.
I would like to plot the data for each chick that participated in
diet 1 on...
2009 Nov 14
4
Weighted descriptives by levels of another variables
...down a subset of the
variables to be described to describe(), but not a subset of the
weights variable. describe() then searches the whatever data set is
attached in order to find the weights variables, but this is in its
original (i.e. not subsetted) form. Here is an example using the
ChickWeight dataset that comes in the "datasets" package.
data(ChickWeight)
attach(ChickWeight)
library(Hmisc)
#this gives descriptive data on the variables "Time" and "Chick" by
levels of "Diet")
by(cbind(Time, Chick), Diet, describe)
#trying to add weights, however,...
2010 Aug 12
2
Linear regression on several groups
I have a simple dataset of a numerical dependent Y, a numerical independent X
and a categorial variable Z with three levels. I want to do linear
regression Y~X for each level of Z. How can I do this in a single command
that is without using lm() applied three isolated times?
--
View this message in context: http://r.789695.n4.nabble.com/Linear-regression-on-several-groups-tp2322835p2322835.html
2008 Jul 30
1
bug in 'margins' behavior in reshape - cast
according to the documentation of the cast function in the reshape function,
I would expect this bit of code from the examples to calculate marginal
means over only the 'diet' variable.
#Chick weight example
names(ChickWeight) <- tolower(names(ChickWeight))
chick_m <- melt(ChickWeight, id=2:4, na.rm=TRUE)
cast(chick_m, diet + chick ~ time, mean, margins="diet")
But,
summary(cast(subset(chick_m, time == 0), diet + chick ~ time, mean,
margins="diet")) returns:
diet chick 0...
2015 Apr 30
2
predict nlme
Estimados
Tengo un error que me desconcierta, es un código que simplifiqué de otro trabajo donde no hay problemas, sin embargo me da un error.
Una diferencia es que en mi otro trabajo uso spline y ahora polinomio, este es de segundo grado y se encuentra tanto en efectos fijos como aleatorios, el modelo es correcto, corre con MCMCglmm pero no con nlme.
grid <- expand.grid(Tiempo=4:6,
2004 Aug 10
0
Check failed after compilation (PR#7159)
...## Title: The Cauchy Distribution
> ### Aliases: Cauchy dcauchy pcauchy qcauchy rcauchy
> ### Keywords: distribution
>
> ### ** Examples
>
> dcauchy(-1:4)
[1] 0.15915494 0.31830989 0.15915494 0.06366198 0.03183099 0.01872411
>
>
>
> cleanEx(); ..nameEx <- "ChickWeight"
>
> ### * ChickWeight
>
> flush(stderr()); flush(stdout())
>
> ### Name: ChickWeight
> ### Title: Weight versus age of chicks on different diets
> ### Aliases: ChickWeight
> ### Keywords: datasets
>
> ### ** Examples
>
> data(ChickWeight)
> coplo...
2010 Mar 12
1
Length as fun.aggregate in cast function of reshape package: unexpected error
...the reshape package's cast function using length as an aggregating function.
Unexpectedly, I receive the error: 2 arguments passed to 'length' which requires 1
I don't understand this at all - the data I'm using is very simple, and appears almost identical to that used in the
ChickWeight example in the package. The problem can be reproduced and is described in more detail below, along with the rationale for what we're trying to do.
Any help would be very gratefully received.
Best wishes
David Wyllie
(code starts here)
# when using the reshape package to summarise laborato...
2005 Feb 02
4
(no subject)
...Monthly Airline Passenger Numbers 1949-1960
BJsales Sales Data with Leading Indicator
BJsales.lead (BJsales)
Sales Data with Leading Indicator
BOD Biochemical Oxygen Demand
CO2 Carbon Dioxide uptake in grass plants
ChickWeight Weight versus age of chicks on different diets
DNase Elisa assay of DNase
EuStockMarkets Daily Closing Prices of Major European Stock
Indices, 1991-1998
Formaldehyde Determination of Formaldehyde
HairEyeColor Hair...
2013 Apr 20
7
Reshape or Plyr?
H all,
I have relative abundance data from >100 sites. This is from acoustic
monitoring and usually the data is for 2-3 nights but in some cases my
be longer like months or years for each location..
The data output from my management data base is proved by species by
night for each location so data frame would look like this below. What I
need to do is sum the Survey_time by Spec_Code for
2007 Apr 24
0
R 2.5.0 is released
...ting NA).
o Assigning class "factor" to an object now requires it has
integer (and not say double) codes.
o structure() ensures that objects with added class "factor" have
integer codes.
o The "formula" and "outer" attributes of datasets 'ChickWeight',
'CO2', 'DNase', 'Indometh', 'Loblolly', 'Orange' and 'Theoph'
now have an empty environment and not the environment used to
dump the datasets in the package.
o Dataset 'Seatbelts' now correctly has class c("mts", "...
2007 Apr 24
0
R 2.5.0 is released
...ting NA).
o Assigning class "factor" to an object now requires it has
integer (and not say double) codes.
o structure() ensures that objects with added class "factor" have
integer codes.
o The "formula" and "outer" attributes of datasets 'ChickWeight',
'CO2', 'DNase', 'Indometh', 'Loblolly', 'Orange' and 'Theoph'
now have an empty environment and not the environment used to
dump the datasets in the package.
o Dataset 'Seatbelts' now correctly has class c("mts", "...
2002 Jul 11
1
dyn.load tcl/tk (PR#1774)
...text html latex example
>>> Building/Updating help pages for package `nls'
Formats: text html latex example
BOD text html latex example
CO2 text html latex example
ChickWeight text html latex example
DNase text html latex example
Indometh text html latex example
Loblolly text html latex example
NLSstAsymptotic text...
2000 Feb 17
2
Installation of rpm file on Suse Linux 6.2 (PR#449)
...: /usr/local/lib/R/library/nls/data action: create
D: file: /usr/local/lib/R/library/nls/data/00Index action: create
D: file: /usr/local/lib/R/library/nls/data/BOD.R action: create
D: file: /usr/local/lib/R/library/nls/data/CO2.R action: create
D: file: /usr/local/lib/R/library/nls/data/ChickWeight.R action: create
D: file: /usr/local/lib/R/library/nls/data/DNase.R action: create
D: file: /usr/local/lib/R/library/nls/data/Indometh.R action: create
D: file: /usr/local/lib/R/library/nls/data/Loblolly.R action: create
D: file: /usr/local/lib/R/library/nls/data/Orange.R action: create...