testGrowth | R Documentation |
Hypothesis testing for fitGrowth models.
testGrowth(ss = NULL, fit, test = "A")
ss |
A list output from growthSS. This is not required for nls, nlme, and brms models
if |
fit |
A model (or list of nlrq models) output from fitGrowth. For brms models this can also be a data.frame of draws. |
test |
A description of the hypothesis to test. This can take two main forms,
either the parameter names to vary before comparing a nested model ("A", "B", "C") using an anova
or a hypothesis test/list of hypothesis tests written as character strings.
The latter method is not implemented for |
For nls and nlme models an anova is run and returned as part of a list along with the null model. For nlrq models several assumptions are made and a likelihood ratio test for each tau is run and returned as a list.
A list containing an anova object comparing non-linear growth models and the null model.
growthSS and fitGrowth for making compatible models, growthPlot for hypothesis testing on compatible models.
set.seed(123)
simdf <- growthSim("logistic",
n = 20, t = 25,
params = list("A" = c(200, 160), "B" = c(13, 11), "C" = c(3, 3.5))
)
ss <- suppressMessages(growthSS(
model = "logistic", form = y ~ time | id / group,
df = simdf, type = "nlrq"
))
fit <- fitGrowth(ss)
testGrowth(ss, fit, "A")
testGrowth(ss, fit, "a|0.5|A > b|0.5|A")
ss2 <- suppressMessages(growthSS(
model = "logistic", form = y ~ time | id / group,
df = simdf, type = "nls"
))
fit2 <- fitGrowth(ss2)
testGrowth(ss2, fit2, "A")$anova
coef(fit2) # check options for contrast testing
testGrowth(ss2, fit2, "A1 - A2*1.1")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.