Displaying 20 results from an estimated 1000 matches similar to: "mixed models"
2005 Sep 05
2
model comparison and Wald-tests (e.g. in lmer)
Dear expeRts,
there is obviously a general trend to use model comparisons, LRT and AIC
instead of Wald-test-based significance, at least in the R community.
I personally like this approach. And, when using LME's, it seems to be
the preferred way (concluded from postings of Brian Ripley and Douglas
Bates' article in R-News 5(2005)1), esp. because of problems with the
d.f. approximation.
2009 May 13
1
Block factor as random or fixed effect?
People
I apologise for asking a general stats question, but I'm at a bit of a
loss as to what to do following some hostile referees' comments. If I
have a fully randomised blocked design, with only three blocks, should
I treat block as a random or fixed effect? I have read comments about
not treating block as a random effect if the number of blocks is less
than 6 or 7: is this
2007 Oct 13
2
How to identify the two largest peaks in a trimodal distribution
Hello all
I'm trying to do a simulation that involves identifying the minimum
point between two peaks of a (usually) bimodal distribution. I can do
this easily if there are only two peaks:
CnBdens<-density(Ys/Xs) #probability density function for ratio of Ys
to Xs
for(p in 1:512) ifelse(CnBdens$y[p]>CnBdens$y[p-1],peak1<-p,break)
#identifies first peak in probability
2008 Mar 14
1
Comparing switchpoints from segmented
Hello everyone
Not strictly an R question but close... hopefully someone will be able
to help. I wish to compare the switchpoints in two switchpoint
regressions. The switchpoints were estimated using the segmented
library running in R, and I have standard errors for the estimates. I
initially thought I could just bootstrap confidence intervals for the
difference between the switchpoints,
2006 Aug 02
0
Trying to use segmented in a function
Hi folks
I wonder if anyone can help me. I want to run some simulations to see
how big a sample size might be necessary to distinguish a curved
bivariate relationship (e.g. something that might be best described
by a quadratic model) from a relationship that is two straight lines
with a sudden change in slope (e.g. something best described by a
breakpoint regression). I am using
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
2010 Nov 08
2
Several lattice plots on one page
Dear all,
I am trying (!!!) to generate pdfs that have 8 plots on one page:
df = data.frame(
day = c(1,2,3,4),
var1 = c(1,2,3,4),
var2 = c(100,200,300,4000),
var3 = c(10,20,300,40000),
var4 = c(100000,20000,30000,4000),
var5 = c(10,20,30,40),
var6 = c(0.001,0.002,0.003,0.004),
var7 = c(123,223,123,412),
var8 = c(213,123,234,435),
all = as.factor(c(1,1,1,1)))
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
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
>
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
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|
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
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
2000 Jul 24
1
How to use groupedData() within a function?
Dear Group:
I have been trying to write an R function within which the function
groupedData() would be used.
The following is a sample program:
#######################
sid<-rep(1:6,times=2)
time<-c(1:12)
trt<-rep(letters[1:3],times=4)
tem<-data.frame(sid,time,trt)
test1.fun<- function(dat=dat)
{
groupedData(time ~ trt|sid, data=dat)
}
test1.fun(dat=tem)
2006 Dec 14
1
Reverse order of grouping factor in grouppedData
I created the following groupedData object (nlme library):
gd <- groupedData(Conc ~ Time | Subj,
order.groups=T,
FUN = myf,
data=mydata)
The idea of the myf function is to reverse the order of the grouping factor
Subj (or better, reorder from largest to smallest). In the mydata data set,
Subj is an integer that gets converted into a factor in the groupedData
object.
Does anyone
2004 Mar 17
1
ANCOVA when you don't know factor levels
Hello people
I am doing some thinking about how to analyse data on dimorphic animals
- where different individuals of the same species have rather different
morphology. An example of this is that some male beetles have large
horns and small wings, and rely on beating the other guys up to get
access to mates, whereas others have smaller horns and larger wings,
and rely on mobility to
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"
2012 Mar 15
1
Accessing variable's name as an attribute?
Sorry - I suspect this is a very basic query.
I have a data frame structured "flat" (i.e. separate observations for a given subject ID on separate lines). Using the nlme library I create a groupedData object suitable for further analysis thus:
dataset <- groupedData(VARIABLE ~ TIME|ID, data=sfa)
The dataset has a large number of VARIABLES of interest so I want to make use of loops
2003 Feb 13
1
fixed and random effects in lme
Hi All,
I would like to ask a question on fixed and random effecti in lme. I am
fiddlying around Mick Crawley dataset "rats" :
http://www.bio.ic.ac.uk/research/mjcraw/statcomp/data/
The advantage is that most work is already done in Crawley's book (page 361
onwards) so I can check what I am doing.
I am tryg to reproduce the nested analysis on page 368:
2008 Feb 06
1
Nested ANOVA models in R
Hi,
I'm trying to work through a Nested ANOVA for the following scenario:
20 males were used to fertilize eggs of 4 females per male, so that
female is nested within male (80 females used total). Spine length
was measured on 11 offspring per family, resulting in 880
measurements on 80 families.
I used the following two commands:
summary(aov(Spinelength ~ Male*Female))
and