Displaying 20 results from an estimated 3000 matches similar to: "How to use groupedData() within a function?"
2001 Nov 19
1
scope of data in groupedData
I'm trying to write a function that has a dataframe as
an argument. Within the function, I call groupedData
to create a grouped-data object from the dataframe
argument. However, the groupedData function doesn't
seem to see the data. I'm guessing it's getting the
argument name rather than its value, but I'm not
positive.
My system: R 1.3.1 on WinNT 4.0 (Pentium II), nlme
2009 Jul 14
1
Problem with GroupedData
Hi,
I have an original data frame with 8 columns of variables, which are stored in 'data1' frame.
data1 <- read.csv("E:\\PHD GLASGOW UNIVERSITY\\Data\\R\\Colin\\Cailness21.csv")
attach(data1)
names(data1)
[1] "Date" "d" "m" "y" "Time"
[6] "Depth" "Temp"
2007 Jan 28
1
extra panel arguments to plot.nmGroupedData {nlme}
Greetings,
I have a groupedData (nmGroupedData) object created with the following syntax:
Soil <- groupedData(
ksat ~ conc | soil_id/sar/rep,
data=soil.data,
labels=list(x='Solution Concentration', y='Saturated Hydraulic Conductivity'),
units=list(x='(cmol_c)', y='(cm/s)')
)
the original data represents longitudinal observations in the form of:
2008 Jan 25
1
nlsList (nlme) error
Hi All.
I'm trying to run nlsList an getting an error that makes no sense to
me. I have accuracy and reaction time data over many trials for each
person (id)
When I use nlsList code that is virtually identical to the example in
the doc file I get the following error. I've tried everything I could
think of and can't get around it. Any ideas what I'm doing wrong?
**************
2004 Jan 17
3
Multiple groupedData plots in a postscript file using a loop
Hallo!
I want to plot multiple grouped data in a postscript
file using a loop. As I use a loop no plot (or just
one empty plot) is generated. Here an example:
library(nlme)
data(Loblolly) # example data from nlme
postscript("PSFile.ps")
for (i in 1:1) # just as example
{
plot(Loblolly)
}
dev.off()
Result: Just an empty PSFile.ps.
(Withoput the loop it works.
May anybody help?
Karl
2004 Jul 23
2
lme4 groupedData is missing
help.search("groupedData") says that it's part of the lme4 package, but it
appears not to be there (details below). Is this because lme4 is new and
(perhaps) still under development?
> update.packages()
trying URL `http://cran.r-project.org/bin/windows/contrib/1.9/PACKAGES'
Content type `text/plain; charset=iso-8859-1' length 19113 bytes
opened URL
downloaded 18Kb
>
2008 Jun 04
2
Constructing groupedData objects in nlme - a little problem
Dear R-help,
I am trying to create groupedData objects using the nlme library. I'm
missing something basic, I know:
Here is the first example in ch.1 of Pinheiro & Bates (2000):
library(nlme)
x2=Rail$travel;x1=Rail$Rail;eg1=data.frame(x1,x2);eg1gd=Rail
print(eg1gd)
x11();print(plot(eg1gd))
femodel=lm(x2~x1-1,data=eg1gd)
print(femodel$coefficients)
Result:
x12 x15 x11
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
...
$
2007 Apr 27
1
Issues with Sweave and inclusion of graphics from nlme
Dear all,
I'm using the nlme package. I would like to introduce the plot of my
groupedData object in my latex report using Sweave but it doesn't work.
I have no error message in R (Sweave(my.file_Rnw)) and the plot is
generated in R, but when I want to see the pdf (I'm using TexnicCenter) of
my report, there is an error message and no pdf file is generated. It seems
that the plot
2018 Mar 22
0
How do I include a factor in a groupedData object? Meaning and use of inner and outer parameters
Dear John
You are only allowed to have the primary covariate on the left hand side
of the vertical bar. Other covariates go in inner or outer.
Michael
On 22/03/2018 12:59, Sorkin, John wrote:
> Windows 10 64-bit, R-Studio, R version 3.4.3
>
>
> Several questions relating to groupedData:
>
> (1) I am trying to create a groupedData object that can be used to run an analysis
2006 Dec 07
2
groupedData Error Using outer=TRUE
I'm using groupedData from nlme. I set up a groupedData data.frame with
outer=~group1. When I try to plot with outer=TRUE, I get "subscript out
of bounds." This happens most of the time. When it works, I get
spaghetti-type plots for comparing groups. But I don't understand why it
doesn't usually work.
> longa.mod.1.gd <- groupedData(mod1.logit~time|
2018 Mar 22
3
How do I include a factor in a groupedData object? Meaning and use of inner and outer parameters
Windows 10 64-bit, R-Studio, R version 3.4.3
Several questions relating to groupedData:
(1) I am trying to create a groupedData object that can be used to run an analysis that I have been able to urn using lmer. When I include the interaction terms in the groupedData opbject I get an error message stating that + is not meaningful for factors. How do I include factors in my model? See code and
2007 Dec 27
2
groupedData function not found
Hello,
I'm trying to use the groupedData function and R is giving me the message: Error: can not find function "groupedData"
The code is coming from a textbook so I think it should be correct:
pigs<-data.frame(cbind(pig.time,pig.id,pig.wt))
pig.growth<-groupedData(pig.wt~pig.time|pig.id,data=pigs)
I have added the package "nlme" and to confirm that it was installed
2005 Mar 17
2
Repeated Measures, groupedData and lme
Hello
I am trying to fit a REML to some soil mineral data which has been
collected over the time period 1999 - 2004. I want to know if the 19
different treatments imposed, differ in terms of their soil mineral
content. A tree model of the data has shown differences between the
treatments can be attributed to the Magnesium, Potassium and organic
matter content of the soil, with Magnesium being the
2009 Oct 15
2
plotting/examining residuals of a mixed generalised linear model
Dear R users,
I'm hoping that more experienced users will be able to assist me in
examining the model fit of a mixed generalised linear model. The example
using the data 'bacteria' within the MASS package will hopefully illustrate
what I would like to acheive;
library(MASS)
library(nlme)
attach(bacteria) # y being output and the trt - treatment group being an
explanatory variable.
2008 Jul 19
1
wroung groupedData despite reading Bates and Pinheiro 3 times
Hi everyone. I am trying to add a formula to my data using the groupedData
function.
My experiment consists of randomized block design using fruits, vegetation
and time as factors. The idea is to see if fruits, vegetation and time
explain the abundance of mice. I am using tree density as a covariate.
So I tried to fit the following structure to my data.
>
2002 Oct 30
1
groupedData
Dear all,
I tried to create a groupedData object, where the grouping factor
is not ordered.
Here ist the code:
library(nlme)
test<-groupedData(conc~Time|Subject,order.groups=F,data=as.data.frame(Theoph))
> getGroups(test)
Levels: 6 < 7 < 8 < 11 < 3 < 2 < 4 < 9 < 12 < 10 < 1 < 5
I still get an ordered factor. As always thanks for your help
peter
2010 Sep 10
1
lme, groupedData, random intercept and slope
Windows Vista
R 2.10.1
Does the following use of groupedData and lme produce an analysis with both random intercept and slope, or only random slope?
zz<-groupedData(y~time | Subject,data=data.frame(data),
labels = list( x = "Time",
y = "y" ),
units = list( x = "(yr)", y = "(mm)")
)
plot(zz)
2008 Nov 14
1
Superimposing y-variables in Lattice formulas
Given a data frame of a categorical variable and two continuous
variables, I would like to display one continuous variable against the
other for each value of the categorical variable, all superimposed on
the same plot. For example:
data(Indometh); str(Indometh)
Classes 'nfnGroupedData', 'nfGroupedData', 'groupedData' and
'data.frame': 66 obs. of 3
2009 Jul 02
1
Problem with groupedData and lme
Dear R-users,
I'm currently having trouble with the implementation of a groupedData
object in the lme() function.
Executing the following function
> applyScalingSimp <- function(input.population)
> {
> ## GA is a time value
> varInOrder <- c("GA","weight","grouping","sex")
> modelVar <-