[R] ANOVA for proportions with large mass on an extreme of [0, 1]

Joaquin Rapela rapela at ucsd.edu
Sat Jun 21 05:54:38 CEST 2014

I am trying to perform an ANOVA on a dependent variable that has large mass
on the 1 side of the (0, 1] interval. I decided to use Fractional Regression
Models, as implemented in the package frm. This package seems well-suited for
my problem, but I don't see how to perform model comparisons of nested frm
models. Please, see data and code below.

I would like to do:

anova(model1, model2)

There is a function frm.ptest(model1, model2), but does not work with nested

Are there alternatives to the frm package to perform ANOVAs on proportions
(with large mass on an extreme of [0, 1])?

Is there a way to model repeated measures (as in package lme4) when the dependent variable is a  proportion?

Data and code

con <- url("http://sccn.ucsd.edu/~rapela/avshift/anovaDataFrame.RData")
myData <- get(load(con))

myData <- myData[!is.na(myData$alternationRate),]
y <- myData$alternationRate


model1 <- frm(y=y, x=model.matrix(~modality*condition+clusterID, data=myData)[, -1], linkfrac="logit", linkbin="logit", type="2P", inflation=1)
model2 <- frm(y=y, x=model.matrix(~modality+condition+clusterID, data=myData)[, -1], linkfrac="logit", linkbin="logit", type="2P", inflation=1)

# this works
frm.ptest(model2, model3)

# but this does not
# frm.ptest(model1, model2)
# Error in frm.ptest(model1, model2) : 
# object 2 is nested in object 1 - no need to use the P test

Thanks, Joaquin

More information about the R-help mailing list