Title: | Nonparametric Analysis of Longitudinal Data in Factorial Experiments |
---|---|
Description: | Performs nonparametric analysis of longitudinal data in factorial experiments. Longitudinal data are those which are collected from the same subjects over time, and they frequently arise in biological sciences. Nonparametric methods do not require distributional assumptions, and are applicable to a variety of data types (continuous, discrete, purely ordinal, and dichotomous). Such methods are also robust with respect to outliers and for small sample sizes. |
Authors: | Kimihiro Noguchi <[email protected]>, Mahbub Latif <[email protected]>, Karthinathan Thangavelu, Frank Konietschke <[email protected]>, Yulia R. Gel <[email protected]>, Edgar Brunner <[email protected]> |
Maintainer: | Frank Konietschke <[email protected]> |
License: | GPL (>= 2) |
Version: | 2.2 |
Built: | 2024-11-26 06:29:57 UTC |
Source: | CRAN |
Measurements of alpha-amylase levels (in U/ml) of the saliva from a group of volunteers.
data(amylase)
data(amylase)
Longitudinal data of 14 probands with alpha-amylase level measurements taken on 8 occasions (4 times per day for 2 days).
In clinical chemistry, it is important for the determination of reference intervals to investigate whether a variable of interest has a circadian rhythm. If so, the reference intervals cannot be determined independently of time. This question is to be analyzed in the case of alpha-amylase in saliva. Measurements of alpha-amylase levels were taken from the saliva of 14 volunteers, four times per day (8 a.m., 12 p.m., 5 p.m., 9 p.m.) on two days (Monday (m), Thursday (t)), since differences in the alpha-amylase profiles immediately after a weekend as opposed to the middle of the week are suspected. Thus, each subject was examined on Monday and Thursday.
Brunner, E., Domhof, S., and Langer, F. (2002). Nonparametric Analysis of Longitudinal Data in Factorial Experiments,
Wiley, New York.
Brunner, E. and Langer, F. (1999). Nichtparametrische Analyse longitudinaler Daten,
R. Oldenbourg Verlag, Munchen Wien.
Noguchi, K., Gel, Y.R., Brunner, E., and Konietschke, F. (2012). nparLD: An R Software Package for the Nonparametric Analysis of Longitudinal Data in Factorial Experiments. Journal of Statistical Software, 50(12), 1-23.
## Analysis using LD-F2 design ## data(amylase) attach(amylase) ex.f2<-ld.f2(y=resp, time1=time1, time2=time2, subject=subject, time1.name="Day", time2.name="Time", description=FALSE) # LD F2 Model # ----------------------- # Check that the order of the time1 and time2 levels are correct. # Time1 level: M T # Time2 level: 8 12 17 21 # If the order is not correct, specify the correct order in time1.order or # time2.order. ## Wald-type statistic ex.f2$Wald.test # Statistic df p-value #Day 0.6761043 1 4.109314e-01 #Time 35.8647640 3 7.997949e-08 #Day:Time 14.3020921 3 2.521503e-03 ## ANOVA-type statistic ex.f2$ANOVA.test # Statistic df p-value #Day 0.6761043 1.000000 4.109314e-01 #Time 14.2671950 2.858344 5.860479e-09 #Day:Time 5.2242782 2.184249 4.150298e-03
## Analysis using LD-F2 design ## data(amylase) attach(amylase) ex.f2<-ld.f2(y=resp, time1=time1, time2=time2, subject=subject, time1.name="Day", time2.name="Time", description=FALSE) # LD F2 Model # ----------------------- # Check that the order of the time1 and time2 levels are correct. # Time1 level: M T # Time2 level: 8 12 17 21 # If the order is not correct, specify the correct order in time1.order or # time2.order. ## Wald-type statistic ex.f2$Wald.test # Statistic df p-value #Day 0.6761043 1 4.109314e-01 #Time 35.8647640 3 7.997949e-08 #Day:Time 14.3020921 3 2.521503e-03 ## ANOVA-type statistic ex.f2$ANOVA.test # Statistic df p-value #Day 0.6761043 1.000000 4.109314e-01 #Time 14.2671950 2.858344 5.860479e-09 #Day:Time 5.2242782 2.184249 4.150298e-03
Measurements of distances (in millimeters) between the center of the pituitary and the pterygomaxillary fissure from a group of boys.
data(dental)
data(dental)
Longitudinal data of of 16 boys with the dental measurements taken on 4 occasions (at the ages 8, 10, 12, and 14).
Potthoff and Roy (1964) use this dental measurement dataset to analyze the growth curve problem to suggest answers to questions such as a suitable form for the function of time, the difference in the curves between boys and girls, and possibility of obtaining confidence bands. The dataset contains the data for boys (see Orthodont
for a complete dataset). The dataset was obtained by investigators at the University of North Carolina Dental School.
Brunner, E., Domhof, S., and Langer, F. (2002). Nonparametric Analysis of Longitudinal Data in Factorial Experiments,
Wiley, New York.
Brunner, E. and Langer, F. (1999). Nichtparametrische Analyse longitudinaler Daten,
R. Oldenbourg Verlag, Munchen Wien.
Noguchi, K., Gel, Y.R., Brunner, E., and Konietschke, F. (2012).
nparLD: An R Software Package for the Nonparametric Analysis of Longitudinal Data in Factorial Experiments.
Journal of Statistical Software, 50(12), 1-23.
Potthoff, R.F. and Roy, S.N. (1964). Generalized multivariate analysis of variance model useful especially for growth curve problems, Biometrika, 51, 313-326.
## Analysis using LD-F1 design ## data(dental) attach(dental) ex.f1<-ld.f1(y=resp, time=time, subject=subject, w.pat=c(1,2,3,4), time.name="Age", description=FALSE, time.order=NULL) # LD F1 Model # ----------------------- # Check that the order of the time level is correct. # Time level: 8 10 12 14 # If the order is not correct, specify the correct order in time.order. ## Wald-type statistic ex.f1$Wald.test # Statistic df p-value #Week 94.47718 3 2.391503e-20 ## ANOVA-type statistic ex.f1$ANOVA.test # Statistic df p-value #Age 31.48774 2.700785 1.437729e-18 ## The same analysis can be done using the wrapper function "nparLD" ## ex.f1np<-nparLD(resp~time, data=dental, subject="subject", description=FALSE) # LD F1 Model # ----------------------- # Check that the order of the time level is correct. # Time level: 8 10 12 14 # If the order is not correct, specify the correct order in time.order.
## Analysis using LD-F1 design ## data(dental) attach(dental) ex.f1<-ld.f1(y=resp, time=time, subject=subject, w.pat=c(1,2,3,4), time.name="Age", description=FALSE, time.order=NULL) # LD F1 Model # ----------------------- # Check that the order of the time level is correct. # Time level: 8 10 12 14 # If the order is not correct, specify the correct order in time.order. ## Wald-type statistic ex.f1$Wald.test # Statistic df p-value #Week 94.47718 3 2.391503e-20 ## ANOVA-type statistic ex.f1$ANOVA.test # Statistic df p-value #Age 31.48774 2.700785 1.437729e-18 ## The same analysis can be done using the wrapper function "nparLD" ## ex.f1np<-nparLD(resp~time, data=dental, subject="subject", description=FALSE) # LD F1 Model # ----------------------- # Check that the order of the time level is correct. # Time level: 8 10 12 14 # If the order is not correct, specify the correct order in time.order.
Measurements of skin temperatures (in degree Celcius/10) of both operated and non-operated hands from a group of patients who had a surgery on a hand.
data(edema)
data(edema)
Longitudinal data of 58 patients from both a treatment and a control group with skin temperatues taken on 4 occasions on each hand, which result in 8 occasions per patient.
Surgical procedures on the hand may lead to a postoperative edema and a reddening of the skin. This is related to an increase in the skin temperature. A randomized clinical study was conducted to investigate whether treatment with a substance (V) effects a faster reduction of the edema and reddening than a placebo (P). Each experimental group consists of 29 patients. Temperature measurements were taken on the same area of both the operated and non-operated hand on the day previous to the operation (day -1) as well as on the first, third and fifth day (days 1, 3, 5) subsequent to the surgery.
Brunner, E., Domhof, S., and Langer, F. (2002). Nonparametric Analysis of Longitudinal Data in Factorial Experiments,
Wiley, New York.
Brunner, E. and Langer, F. (1999). Nichtparametrische Analyse longitudinaler Daten,
R. Oldenbourg Verlag, Munchen Wien.
Noguchi, K., Gel, Y.R., Brunner, E., and Konietschke, F. (2012). nparLD: An R Software Package for the Nonparametric Analysis of Longitudinal Data in Factorial Experiments. Journal of Statistical Software, 50(12), 1-23.
## Analysis using F1-LD-F2 design ## data(edema) attach(edema) ex.f1f2<-f1.ld.f2(y=resp, time1=time1, time2=time2, group=group, subject=subject, time1.name="Hand", time2.name="Day", group.name="Treatment", description=FALSE) # F1 LD F2 Model # ----------------------- # Check that the order of the time1, time2, and group levels are correct. # Time1 level: Healthy Operated # Time2 level: -1 1 3 5 # Group level: Drug Placebo # If the order is not correct, specify the correct order in time1.order, # time2.order, or group.order. ## Wald-type statistic ex.f1f2$Wald.test # Statistic df p-value #Treatment 1.0725762 1 3.003643e-01 #Hand 25.8758257 1 3.641005e-07 #Day 36.8857947 3 4.864630e-08 #Treatment:Hand 0.3304448 1 5.653973e-01 #Day:Hand 47.3460508 3 2.933702e-10 #Treatment:Day 5.3048189 3 1.507900e-01 #Treatment:Hand:Day 1.6581652 3 6.462743e-01 ## ANOVA-type statistic ex.f1f2$ANOVA.test # Statistic df p-value #Treatment 1.0725762 1.000000 3.003643e-01 #Hand 25.8758257 1.000000 3.641005e-07 #Day 11.0630080 2.699667 9.661602e-07 #Treatment:Hand 0.3304448 1.000000 5.653973e-01 #Day:Hand 15.1854889 2.630202 6.184646e-09 #Treatment:Day 1.3342605 2.699667 2.625538e-01 #Treatment:Hand:Day 0.7170325 2.630202 5.242367e-01
## Analysis using F1-LD-F2 design ## data(edema) attach(edema) ex.f1f2<-f1.ld.f2(y=resp, time1=time1, time2=time2, group=group, subject=subject, time1.name="Hand", time2.name="Day", group.name="Treatment", description=FALSE) # F1 LD F2 Model # ----------------------- # Check that the order of the time1, time2, and group levels are correct. # Time1 level: Healthy Operated # Time2 level: -1 1 3 5 # Group level: Drug Placebo # If the order is not correct, specify the correct order in time1.order, # time2.order, or group.order. ## Wald-type statistic ex.f1f2$Wald.test # Statistic df p-value #Treatment 1.0725762 1 3.003643e-01 #Hand 25.8758257 1 3.641005e-07 #Day 36.8857947 3 4.864630e-08 #Treatment:Hand 0.3304448 1 5.653973e-01 #Day:Hand 47.3460508 3 2.933702e-10 #Treatment:Day 5.3048189 3 1.507900e-01 #Treatment:Hand:Day 1.6581652 3 6.462743e-01 ## ANOVA-type statistic ex.f1f2$ANOVA.test # Statistic df p-value #Treatment 1.0725762 1.000000 3.003643e-01 #Hand 25.8758257 1.000000 3.641005e-07 #Day 11.0630080 2.699667 9.661602e-07 #Treatment:Hand 0.3304448 1.000000 5.653973e-01 #Day:Hand 15.1854889 2.630202 6.184646e-09 #Treatment:Day 1.3342605 2.699667 2.625538e-01 #Treatment:Hand:Day 0.7170325 2.630202 5.242367e-01
This function performs several tests for the relative treatment effects with global or patterned alternatives for the F1-LD-F1 design (see Details for the definition). For the experiments with F1-LD-F1 design, the Wald-type statistic (WTS), the ANOVA-type statistic (ATS), and the modified ANOVA-type statistic with Box (1954) approximation are calculated for testing group and time effects, and interaction. The hypothesis can also be tested against patterned alternatives to detect various trends. Moreover, pairwise comparisons of the groups, patterned interactions, and patterned group effects can be tested using this function.
f1.ld.f1(y, time, group, subject, w.pat=NULL, w.t=NULL, w.g=NULL, time.name="Time", group.name="Group", description=TRUE, time.order=NULL, group.order=NULL, plot.RTE=TRUE, show.covariance=FALSE, order.warning=TRUE)
f1.ld.f1(y, time, group, subject, w.pat=NULL, w.t=NULL, w.g=NULL, time.name="Time", group.name="Group", description=TRUE, time.order=NULL, group.order=NULL, plot.RTE=TRUE, show.covariance=FALSE, order.warning=TRUE)
y |
a vector of numeric variable of interest; missing values should be specified as NA. |
time |
a vector of the sub-plot factor variable. See Details for more explanation. |
group |
a vector of the whole-plot factor variable. See Details for more explanation. |
subject |
a vector of individual subjects. |
w.pat |
an A-by-T matrix specifying the pattern for the pattern alternatives where A is the group level and T is the time level; the default option is NULL. |
w.t |
a vector of time pattern for the pattern alternatives; the default option is NULL. The length, if specified, must be equal to the number of time levels. |
w.g |
a vector of group pattern for the pattern alternatives; the default option is NULL. The length, if specified, must be equal to the number of group levels. |
time.name |
a character vector specifying the name of the time vector; the default option is "Time". |
group.name |
a character vector specifying the name of the group vector; the default option is "Group". |
description |
an indicator for whether a short description of the output should be shown; the default option is TRUE. |
time.order |
a character or numeric vector specifying the order of the time levels; the default option is NULL, in which case, the levels are in the order of the original data. |
group.order |
a character or numeric vector specifying the order of the group levels; the default option is NULL, in which case, the levels are in the order of the original data. |
plot.RTE |
an indicator for whether a plot of the relative treatment effect (RTE) should be shown; the default option is TRUE. |
show.covariance |
an indicator for whether the covariance matrix should be shown; the default option is FALSE, in which case, NULL is returned. |
order.warning |
an indicator for whether a short description of the warning regarding the ordering of factors should be shown; the default option is TRUE. |
The F1-LD-F1 design refers to the experimental design with one whole-plot factor and one sub-plot factor. A whole-plot factor refers to a factor effective for each subject at all times. A sub-plot factor refers to a factor effective at a single time point for all time curves and all subjects. See Brunner et al. (2002) for more examples.
A list with the following numeric components.
RTE |
summary of the relative treatment effect (RTE) in a n-by-3 matrix form, where n is the total number of time points, group levels, and group-time interactions; the summary includes the mean of the ranks (RankMeans) in the 1st column, number of observations without counting the repeated measurements within the cell (Nobs) in the 2nd column, and the relative treatment effect (RTE) in the 3rd column. |
case2x2 |
the test statistic, corresponding p-value (approximated by standard normal distribution), degrees of freedom (df) for Student's t distribution, and corresponding p-value (approximated by Student's t distribution with the degrees of freedom in the previous column) for the 2-by-2 design with no missing observations. For the cases which do not use the 2-by-2 design, or when there is a missing value in the 2-by-2 design, case2x2 returns NULL. |
Wald.test |
the test statistic, degrees of freedom (df) for the central chi-square distribution, and corresponding p-value of the Wald-type test. |
ANOVA.test |
the test statistic, numerator degrees of freedom (df) for the central F distribution, and corresponding p-value of the ANOVA-type test; denominator degrees of freedom is set to infinity. |
ANOVA.test.mod.Box |
the test statistic, numerator and denominator degrees of freedom (df1, df2), respectively, for the central F distribution, and corresponding p-value of the ANOVA-type test for the whole-plot factor. |
Wald.test.time |
the test statistic and corresponding p-value of the Wald-type test with the hypothesis of no simple time effects. |
ANOVA.test.time |
the test statistic and corresponding p-value of the ANOVA-type test with the hypothesis of no simple time effects. |
pattern.time |
the test statistic, corresponding p-value (approximated by standard normal distribution), degrees of freedom (df) for Student's t distribution, and corresponding p-value (approximated by Student's t distribution with the degrees of freedom in the previous column) to test for patterned simple time effects. If the pattern (w.pat) is not specified, pattern.time returns NULL. |
pair.comparison |
the test statistic, degrees of freedom (df), and the corresponding p-value of the pairwise comparisons. |
pattern.pair.comparison |
the test statistic, corresponding p-value (approximated by standard normal distribution), degrees of freedom (df) for Student's t distribution, and corresponding p-value (approximated by Student's t distribution with the degrees of freedom in the previous column) to test for patterned interactions. |
pattern.group |
the test statistic, corresponding p-value (approximated by standard normal distribution), degrees of freedom (df) for Student's t distribution, and corresponding p-value (approximated by Student's t distribution with the degrees of freedom in the previous column) to test for patterned group effects. |
covariance |
the covariance matrix. |
model.name |
the name of the model used. |
Kimihiro Noguchi, Mahbub Latif, Frank Konietschke, Yulia Gel, Edgar Brunner
Box, G.E.P. (1954). Some theorems on quadratic forms applied in the study of analysis of variance problems, I. Effect of inequality of variance in the one-way classification. Annals of Mathematical Statistics, 25, 290-302.
Brunner, E., Domhof, S., and Langer, F. (2002). Nonparametric Analysis of Longitudinal Data in Factorial Experiments,
Wiley, New York.
Brunner, E. and Langer, F. (1999). Nichtparametrische Analyse longitudinaler Daten,
R. Oldenbourg Verlag, Munchen Wien.
Noguchi, K., Gel, Y.R., Brunner, E., and Konietschke, F. (2012). nparLD: An R Software Package for the Nonparametric Analysis of Longitudinal Data in Factorial Experiments. Journal of Statistical Software, 50(12), 1-23.
nparLD
, ld.f1
, ld.f2
,
f1.ld.f2
, f2.ld.f1
, ld.ci
,
tree
## Example with the "Vitality of treetops" data ## data(tree) attach(tree) w.t<-c(1:4) w.g<-c(1:3) w.pat <- rbind(c(1:4), c(1:4), c(1:4)) ex.f1f1<-f1.ld.f1(y=resp, time=time, group=group, subject=subject, w.pat=w.pat, w.t=w.t, w.g=w.g, time.name="Year", group.name="Area", description=FALSE, time.order=c(1,2,3,4), group.order=c("D0","D1","D2")) # F1 LD F1 Model # ----------------------- # Check that the order of the time and group levels are correct. # Time level: 1 2 3 4 # Group level: D0 D1 D2 # If the order is not correct, specify the correct order in time.order or # group.order. ## Wald-type statistic ex.f1f1$Wald.test # Statistic df p-value #Area 4.510037 2 1.048716e-01 #Year 58.061097 3 1.525356e-12 #Area:Year 14.819966 6 2.170415e-02 ## ANOVA-type statistic ex.f1f1$ANOVA.test # Statistic df p-value #Area 2.352854 1.968147 9.601181e-02 #Year 21.389142 2.729147 8.210954e-13 #Area:Year 3.113632 5.346834 6.768732e-03 ## ANOVA-type statistic for the whole-plot factor ex.f1f1$ANOVA.test.mod.Box # Statistic df1 df2 p-value #Area 2.352854 1.968147 64.3979 0.1040525
## Example with the "Vitality of treetops" data ## data(tree) attach(tree) w.t<-c(1:4) w.g<-c(1:3) w.pat <- rbind(c(1:4), c(1:4), c(1:4)) ex.f1f1<-f1.ld.f1(y=resp, time=time, group=group, subject=subject, w.pat=w.pat, w.t=w.t, w.g=w.g, time.name="Year", group.name="Area", description=FALSE, time.order=c(1,2,3,4), group.order=c("D0","D1","D2")) # F1 LD F1 Model # ----------------------- # Check that the order of the time and group levels are correct. # Time level: 1 2 3 4 # Group level: D0 D1 D2 # If the order is not correct, specify the correct order in time.order or # group.order. ## Wald-type statistic ex.f1f1$Wald.test # Statistic df p-value #Area 4.510037 2 1.048716e-01 #Year 58.061097 3 1.525356e-12 #Area:Year 14.819966 6 2.170415e-02 ## ANOVA-type statistic ex.f1f1$ANOVA.test # Statistic df p-value #Area 2.352854 1.968147 9.601181e-02 #Year 21.389142 2.729147 8.210954e-13 #Area:Year 3.113632 5.346834 6.768732e-03 ## ANOVA-type statistic for the whole-plot factor ex.f1f1$ANOVA.test.mod.Box # Statistic df1 df2 p-value #Area 2.352854 1.968147 64.3979 0.1040525
This function performs several tests for the relative treatment effects with global or patterned alternatives for the F1-LD-F2 design (see Details for the definition). For the experiments with F1-LD-F2 design, the Wald-type statistic (WTS) and the ANOVA-type statistic (ATS) are calculated.
f1.ld.f2(y, time1, time2, group, subject, time1.name="Time1", time2.name="Time2", group.name="Group", description=TRUE, time1.order=NULL, time2.order=NULL, group.order=NULL, plot.RTE=TRUE, show.covariance=FALSE, order.warning=TRUE)
f1.ld.f2(y, time1, time2, group, subject, time1.name="Time1", time2.name="Time2", group.name="Group", description=TRUE, time1.order=NULL, time2.order=NULL, group.order=NULL, plot.RTE=TRUE, show.covariance=FALSE, order.warning=TRUE)
y |
a vector of numeric variable of interest; missing values should be specified as NA. |
time1 |
a vector of the first sub-plot factor variable. See Details for more explanation. |
time2 |
a vector of the second sub-plot factor variable. See Details for more explanation. |
group |
a vector of the whole-plot factor variable. See Details for more explanation. |
subject |
a vector of individual subjects. |
time1.name |
a character vector specifying the name of the time1 vector; the default option is "Treatment". |
time2.name |
a character vector specifying the name of the time2 vector; the default option is "Time". |
group.name |
a character vector specifying the name of the group vector; the default option is "Group". |
description |
an indicator for whether a short description of the output should be shown; the default option is TRUE. |
time1.order |
a character or numeric vector specifying the order of the time1 levels; the default option is NULL, in which case, the levels are in the order of the original data. |
time2.order |
a character or numeric vector specifying the order of the time2 levels; the default option is NULL, in which case, the levels are in the order of the original data. |
group.order |
a character or numeric vector specifying the order of the group levels; the default option is NULL, in which case, the levels are in the order of the original data. |
plot.RTE |
an indicator for whether a plot of the relative treatment effect (RTE) should be shown; the default option is TRUE. |
show.covariance |
an indicator for whether the covariance matrix should be shown; the default option is FALSE, in which case, NULL is returned. |
order.warning |
an indicator for whether a short description of the warning regarding the ordering of factors should be shown; the default option is TRUE. |
The F1-LD-F2 design refers to the experimental design with one whole-plot factor and two sub-plot factors (where time2 is the stratification of time1). A whole-plot factor refers to a factor effective for each subject at all times. A sub-plot factor refers to a factor effective at a single time point for all time curves and all subjects. See Brunner et al. (2002) for more examples.
A list with the following numeric components.
RTE |
summary of the relative treatment effect (RTE) in a n-by-3 matrix form, where n is the total number of time1, time2, and group levels, and group-time interactions; the summary includes the mean of the ranks (RankMeans) in the 1st column, number of observations without counting the repeated measurements within the cell (Nobs) in the 2nd column, and the relative treatment effect (RTE) in the 3rd column. |
Wald.test |
the test statistic, degrees of freedom (df) for the central chi-square distribution, and corresponding p-value of the Wald-type test. |
ANOVA.test |
the test statistic, numerator degrees of freedom (df) for the central F distribution, and corresponding p-value of the ANOVA-type test; denominator degrees of freedom is set to infinity. |
ANOVA.test.mod.Box |
the test statistic, numerator and denominator degrees of freedom (df1, df2), respectively, for the central F distribution, and corresponding p-value of the ANOVA-type test for the whole-plot factor. |
covariance |
the covariance matrix. |
model.name |
the name of the model used. |
Version 1.3 of the f1.ld.f2 function had problems with calculations of the statistics with unequal group sizes, and the issues have been resolved in Version 2.0. We would like to thank Dr. Fernando Marmolejo-Ramos for bringing this to our attention.
Kimihiro Noguchi, Karthinathan Thangavelu, Frank Konietschke, Yulia Gel, Edgar Brunner
Brunner, E., Domhof, S., and Langer, F. (2002). Nonparametric Analysis of Longitudinal Data in Factorial Experiments,
Wiley, New York.
Brunner, E. and Langer, F. (1999). Nichtparametrische Analyse longitudinaler Daten,
R. Oldenbourg Verlag, Munchen Wien.
Noguchi, K., Gel, Y.R., Brunner, E., and Konietschke, F. (2012). nparLD: An R Software Package for the Nonparametric Analysis of Longitudinal Data in Factorial Experiments. Journal of Statistical Software, 50(12), 1-23.
nparLD
, ld.f1
, ld.f2
,
f1.ld.f1
, f2.ld.f1
, ld.ci
,
edema
## Example with the "Postoperative edema" data ## data(edema) attach(edema) ex.f1f2<-f1.ld.f2(y=resp, time1=time1, time2=time2, group=group, subject=subject, time1.name="Hand", time2.name="Day", group.name="Treatment", description=FALSE, time1.order=c("Healthy","Operated"), time2.order=c(-1,1,3,5), group.order=c("Drug","Placebo")) # F1 LD F2 Model # ----------------------- # Check that the order of the time1, time2, and group levels are correct. # Time1 level: Healthy Operated # Time2 level: -1 1 3 5 # Group level: Drug Placebo # If the order is not correct, specify the correct order in time1.order, # time2.order, or group.order. ## Wald-type statistic ex.f1f2$Wald.test # Statistic df p-value #Treatment 1.0725762 1 3.003643e-01 #Hand 25.8758257 1 3.641005e-07 #Day 36.8857947 3 4.864630e-08 #Treatment:Hand 0.3304448 1 5.653973e-01 #Day:Hand 47.3460508 3 2.933702e-10 #Treatment:Day 5.3048189 3 1.507900e-01 #Treatment:Hand:Day 1.6581652 3 6.462743e-01 ## ANOVA-type statistic ex.f1f2$ANOVA.test # Statistic df p-value #Treatment 1.0725762 1.000000 3.003643e-01 #Hand 25.8758257 1.000000 3.641005e-07 #Day 11.0630080 2.699667 9.661602e-07 #Treatment:Hand 0.3304448 1.000000 5.653973e-01 #Day:Hand 15.1854889 2.630202 6.184646e-09 #Treatment:Day 1.3342605 2.699667 2.625538e-01 #Treatment:Hand:Day 0.7170325 2.630202 5.242367e-01 ## ANOVA-type statistic for the whole-plot factor ex.f1f2$ANOVA.test.mod.Box # Statistic df1 df2 p-value #Treatment 1.072576 1 55.80551 0.3048313
## Example with the "Postoperative edema" data ## data(edema) attach(edema) ex.f1f2<-f1.ld.f2(y=resp, time1=time1, time2=time2, group=group, subject=subject, time1.name="Hand", time2.name="Day", group.name="Treatment", description=FALSE, time1.order=c("Healthy","Operated"), time2.order=c(-1,1,3,5), group.order=c("Drug","Placebo")) # F1 LD F2 Model # ----------------------- # Check that the order of the time1, time2, and group levels are correct. # Time1 level: Healthy Operated # Time2 level: -1 1 3 5 # Group level: Drug Placebo # If the order is not correct, specify the correct order in time1.order, # time2.order, or group.order. ## Wald-type statistic ex.f1f2$Wald.test # Statistic df p-value #Treatment 1.0725762 1 3.003643e-01 #Hand 25.8758257 1 3.641005e-07 #Day 36.8857947 3 4.864630e-08 #Treatment:Hand 0.3304448 1 5.653973e-01 #Day:Hand 47.3460508 3 2.933702e-10 #Treatment:Day 5.3048189 3 1.507900e-01 #Treatment:Hand:Day 1.6581652 3 6.462743e-01 ## ANOVA-type statistic ex.f1f2$ANOVA.test # Statistic df p-value #Treatment 1.0725762 1.000000 3.003643e-01 #Hand 25.8758257 1.000000 3.641005e-07 #Day 11.0630080 2.699667 9.661602e-07 #Treatment:Hand 0.3304448 1.000000 5.653973e-01 #Day:Hand 15.1854889 2.630202 6.184646e-09 #Treatment:Day 1.3342605 2.699667 2.625538e-01 #Treatment:Hand:Day 0.7170325 2.630202 5.242367e-01 ## ANOVA-type statistic for the whole-plot factor ex.f1f2$ANOVA.test.mod.Box # Statistic df1 df2 p-value #Treatment 1.072576 1 55.80551 0.3048313
This function performs several tests for the relative treatment effects with global or patterned alternatives for the F2-LD-F1 design (see Details for the definition). For the experiments with F2-LD-F1 design, the Wald-type statistic (WTS), the ANOVA-type statistic (ATS), and the modified ANOVA-type statistic with Box (1954) approximation are calculated for testing group and time effects, and interaction.
f2.ld.f1(y, time, group1, group2, subject, time.name="Time", group1.name="GroupA", group2.name="GroupB", description=TRUE, time.order=NULL, group1.order=NULL, group2.order=NULL, plot.RTE=TRUE, show.covariance=FALSE, order.warning=TRUE)
f2.ld.f1(y, time, group1, group2, subject, time.name="Time", group1.name="GroupA", group2.name="GroupB", description=TRUE, time.order=NULL, group1.order=NULL, group2.order=NULL, plot.RTE=TRUE, show.covariance=FALSE, order.warning=TRUE)
y |
a vector of numeric variable of interest; missing values should be specified as NA. |
time |
a vector of the sub-plot factor variable. See Details for more explanation. |
group1 |
a vector of the first whole-plot factor variable. See Details for more explanation. |
group2 |
a vector of the second whole-plot factor variable. See Details for more explanation. |
subject |
a vector of individual subjects |
time.name |
a character vector specifying the name of the time vector; the default option is "Time". |
group1.name |
a character vector specifying the name of the group1 vector; the default option is "GroupA". |
group2.name |
a character vector specifying the name of the group2 vector; the default option is "GroupB". |
description |
an indicator for whether a short description of the output should be shown; the default option is TRUE. |
time.order |
a character or numeric vector specifying the order of the time levels; the default option is NULL. |
group1.order |
a character or numeric vector specifying the order of the time2 levels; the default option is NULL, in which case, the levels are in the order of the original data. |
group2.order |
a character or numeric vector specifying the order of the group levels; the default option is NULL, in which case, the levels are in the order of the original data. |
plot.RTE |
an indicator for whether a plot of the relative treatment effect (RTE) should be shown; the default option is TRUE. |
show.covariance |
an indicator for whether the covariance matrix should be shown; the default option is FALSE, in which case, NULL is returned. |
order.warning |
an indicator for whether a short description of the warning regarding the ordering of factors should be shown; the default option is TRUE. |
The F2-LD-F1 design refers to the experimental design with two whole-plot factors (where group2 is the stratification of group1) and one sub-plot factor. A whole-plot factor refers to a factor effective for each subject at all times. A sub-plot factor refers to a factor effective at a single time point for all time curves and all subjects. See Brunner et al. (2002) for more examples.
A list with the following numeric components.
RTE |
summary of the relative treatment effect (RTE) in a n-by-3 matrix form, where n is the total number of time, group1, and group2 levels, and group-time interactions; the summary includes the mean of the ranks (RankMeans) in the 1st column, number of observations without counting the repeated measurements within the cell (Nobs) in the 2nd column, and the relative treatment effect (RTE) in the 3rd column. |
Wald.test |
the test statistic, degrees of freedom (df) for the central chi-square distribution, and corresponding p-value of the Wald-type test. |
ANOVA.test |
the test statistic, numerator degrees of freedom (df) for the central F distribution, and corresponding p-value of the ANOVA-type test; denominator degrees of freedom is set to infinity. |
ANOVA.test.mod.Box |
the test statistic, numerator and denominator degrees of freedom (df1, df2), respectively, for the central F distribution, and corresponding p-value of the ANOVA-type test for the whole-plot factors and their interaction. |
covariance |
the covariance matrix. |
model.name |
the name of the model used. |
Kimihiro Noguchi, Karthinathan Thangavelu, Frank Konietschke, Yulia Gel, Edgar Brunner
Box, G.E.P. (1954). Some theorems on quadratic forms applied in the study of analysis of variance problems, I. Effect of inequality of variance in the one-way classification. Annals of Mathematical Statistics, 25, 290-302.
Brunner, E., Domhof, S., and Langer, F. (2002). Nonparametric Analysis of Longitudinal Data in Factorial Experiments,
Wiley, New York.
Brunner, E. and Langer, F. (1999). Nichtparametrische Analyse longitudinaler Daten,
R. Oldenbourg Verlag, Munchen Wien.
Noguchi, K., Gel, Y.R., Brunner, E., and Konietschke, F. (2012). nparLD: An R Software Package for the Nonparametric Analysis of Longitudinal Data in Factorial Experiments. Journal of Statistical Software, 50(12), 1-23.
nparLD
, ld.f1
, ld.f2
,
f1.ld.f1
, f1.ld.f2
, ld.ci
,
shoulder
## Example with the "Shoulder tip pain study" data ## data(shoulder) attach(shoulder) ex.f2f1<-f2.ld.f1(y=resp, time=time, group1=group1, group2=group2, subject=subject, time.name="Time", group1.name="Treatment", group2.name="Gender", description=FALSE, time.order=c(1,2,3,4,5,6), group1.order=c("Y","N"), group2.order=c("F","M")) # F2 LD F1 Model # ----------------------- # Check that the order of the time, group1, and group2 levels are correct. # Time level: 1 2 3 4 5 6 # Group1 level: Y N # Group2 level: F M # If the order is not correct, specify the correct order in time.order, # group1.order, or group2.order. # # # Warning(s): # The covariance matrix is singular. ## Wald-type statistic ex.f2f1$Wald.test # Statistic df p-value #Treatment 16.40129021 1 5.125033e-05 #Gender 0.04628558 1 8.296575e-01 #Time 16.34274332 5 5.930698e-03 #Treatment:Gender 0.03583558 1 8.498554e-01 #Treatment:Time 27.51450085 5 4.527996e-05 #Gender:Time 12.37903186 5 2.994753e-02 #Treatment:Gender:Time 5.11864769 5 4.015727e-01 ## ANOVA-type statistic ex.f2f1$ANOVA.test # Statistic df p-value #Treatment 16.40129021 1.000000 5.125033e-05 #Gender 0.04628558 1.000000 8.296575e-01 #Time 3.38218704 2.700754 2.120366e-02 #Treatment:Gender 0.03583558 1.000000 8.498554e-01 #Treatment:Time 3.71077200 2.700754 1.398190e-02 #Gender:Time 1.14434841 2.700754 3.272967e-01 #Treatment:Gender:Time 0.43755394 2.700754 7.054255e-01 ## ANOVA-type statistic for the whole-plot factors and ## their interaction ex.f2f1$ANOVA.test.mod.Box # Statistic df1 df2 p-value #Treatment 16.40129021 1 21.86453 0.0005395379 #Gender 0.04628558 1 21.86453 0.8316516274 #Treatment:Gender 0.03583558 1 21.86453 0.8516017168
## Example with the "Shoulder tip pain study" data ## data(shoulder) attach(shoulder) ex.f2f1<-f2.ld.f1(y=resp, time=time, group1=group1, group2=group2, subject=subject, time.name="Time", group1.name="Treatment", group2.name="Gender", description=FALSE, time.order=c(1,2,3,4,5,6), group1.order=c("Y","N"), group2.order=c("F","M")) # F2 LD F1 Model # ----------------------- # Check that the order of the time, group1, and group2 levels are correct. # Time level: 1 2 3 4 5 6 # Group1 level: Y N # Group2 level: F M # If the order is not correct, specify the correct order in time.order, # group1.order, or group2.order. # # # Warning(s): # The covariance matrix is singular. ## Wald-type statistic ex.f2f1$Wald.test # Statistic df p-value #Treatment 16.40129021 1 5.125033e-05 #Gender 0.04628558 1 8.296575e-01 #Time 16.34274332 5 5.930698e-03 #Treatment:Gender 0.03583558 1 8.498554e-01 #Treatment:Time 27.51450085 5 4.527996e-05 #Gender:Time 12.37903186 5 2.994753e-02 #Treatment:Gender:Time 5.11864769 5 4.015727e-01 ## ANOVA-type statistic ex.f2f1$ANOVA.test # Statistic df p-value #Treatment 16.40129021 1.000000 5.125033e-05 #Gender 0.04628558 1.000000 8.296575e-01 #Time 3.38218704 2.700754 2.120366e-02 #Treatment:Gender 0.03583558 1.000000 8.498554e-01 #Treatment:Time 3.71077200 2.700754 1.398190e-02 #Gender:Time 1.14434841 2.700754 3.272967e-01 #Treatment:Gender:Time 0.43755394 2.700754 7.054255e-01 ## ANOVA-type statistic for the whole-plot factors and ## their interaction ex.f2f1$ANOVA.test.mod.Box # Statistic df1 df2 p-value #Treatment 16.40129021 1 21.86453 0.0005395379 #Gender 0.04628558 1 21.86453 0.8316516274 #Treatment:Gender 0.03583558 1 21.86453 0.8516017168
This function performs calculations of the two-sided confidence intervals for the relative treatment effects of the factors specified. The function performs calculations only if no observations are missing.
ld.ci(y, time, subject, group=NULL, alpha=0.05, time.name="Time", group.name="Group", description=TRUE, time.order=NULL, group.order=NULL, rounds=4, plot.CI=TRUE, order.warning=TRUE)
ld.ci(y, time, subject, group=NULL, alpha=0.05, time.name="Time", group.name="Group", description=TRUE, time.order=NULL, group.order=NULL, rounds=4, plot.CI=TRUE, order.warning=TRUE)
y |
a vector of numeric variable of interest. |
time |
a vector of the sub-plot factor variable. See Details for more explanation. |
subject |
a vector of individual subjects. |
group |
a vector of the whole-plot factor variable; the default option is NULL. See Details for more explanation. |
alpha |
a numeric specifying the significance level of the confidence intervals; the default option is 0.05. |
time.name |
a vector of the sub-plot factor variable. |
group.name |
a vector of the whole-plot factor variable. |
description |
an indicator for whether a short description of the output should be shown; the default option is TRUE. |
time.order |
a character or numeric vector specifying the order of the time levels; the default option is NULL, in which case, the levels are in the order of the original data. |
group.order |
a character or numeric vector specifying the order of the group levels; the default option is NULL, in which case, the levels are in the order of the original data. |
rounds |
a numeric specifying the number of digits to be displayed. |
plot.CI |
an indicator for whether a plot of the confidence interval (CI) should be shown; the default option is TRUE. |
order.warning |
an indicator for whether a short description of the warning regarding the ordering of factors should be shown; the default option is TRUE. |
A whole-plot factor refers to a factor effective for each subject at all times. A sub-plot factor refers to a factor effective at a single time point for all time curves and all subjects. See Brunner et al. (2002) for more examples. Also, note that the interval for the relative treatment effects can only be interpreted as a confidence interval when the sample sample sizes are (approximately) the same (pp.60, Brunner et al., 2002).
The function returns a list with the following numeric components: the relative treatment effect (RTE), bias estimation (Bias), variance estimation (Variance), the lower and upper bound of the RTE (Lower bound, Upper bound, respectively), in the form of an n-by-9 data frame where n is the number of group factor levels times the number of time factor levels.
Kimihiro Noguchi, Karthinathan Thangavelu, Frank Konietschke, Yulia Gel, Edgar Brunner
Brunner, E., Domhof, S., and Langer, F. (2002). Nonparametric Analysis of Longitudinal Data in Factorial Experiments,
Wiley, New York.
Brunner, E. and Langer, F. (1999). Nichtparametrische Analyse longitudinaler Daten,
R. Oldenbourg Verlag, Munchen Wien.
Noguchi, K., Gel, Y.R., Brunner, E., and Konietschke, F. (2012). nparLD: An R Software Package for the Nonparametric Analysis of Longitudinal Data in Factorial Experiments. Journal of Statistical Software, 50(12), 1-23.
nparLD
, ld.f1
, ld.f2
,
f1.ld.f1
, f1.ld.f2
, f2.ld.f1
,
shoulder
## Example with the "Shoulder tip pain study" data ## data(shoulder) attach(shoulder) group<-paste(group1, group2, sep="") ex.ci<-ld.ci(y=resp, time=time, subject=subject, group=group, alpha=0.05, time.name="Time", group.name="Group", description=FALSE, time.order=c(1,2,3,4,5,6), group.order=c("YF","YM","NF","NM")) # LD CI Calculations # ----------------------- # Order of the time and group levels. # Time level: 1 2 3 4 5 6 # Group level: YF YM NF NM # The order may be specified in time.order or group.order. ## Summary of the output ex.ci # Group Time Nobs RankMeans RTE Bias Variance Lower Upper #1 GroupYF 1 14 123.9643 0.5019 0.0008 0.1680 0.3792 0.6243 #2 GroupYF 2 14 100.2857 0.4056 0.0003 0.1366 0.3000 0.5222 #3 GroupYF 3 14 89.2500 0.3608 -0.0005 0.0979 0.2722 0.4615 #4 GroupYF 4 14 101.4643 0.4104 0.0000 0.1136 0.3131 0.5164 #5 GroupYF 5 14 72.1071 0.2911 -0.0004 0.0389 0.2351 0.3554 #6 GroupYF 6 14 84.3214 0.3407 -0.0002 0.0808 0.2605 0.4329 #7 GroupYM 1 8 107.4375 0.4347 -0.0002 0.3093 0.2786 0.6060 #8 GroupYM 2 8 113.4375 0.4591 0.0002 0.2607 0.3120 0.6142 #9 GroupYM 3 8 87.3750 0.3532 0.0001 0.1464 0.2471 0.4774 #10 GroupYM 4 8 76.6875 0.3097 0.0002 0.0873 0.2277 0.4070 #11 GroupYM 5 8 92.0625 0.3722 -0.0001 0.2011 0.2487 0.5167 #12 GroupYM 6 8 92.0625 0.3722 -0.0001 0.2011 0.2487 0.5167 #13 GroupNF 1 11 154.3636 0.6255 0.0004 0.2954 0.4500 0.7708 #14 GroupNF 2 11 174.3636 0.7068 0.0007 0.1890 0.5573 0.8188 #15 GroupNF 3 11 162.4545 0.6584 -0.0001 0.1941 0.5130 0.7768 #16 GroupNF 4 11 182.2273 0.7387 0.0007 0.1704 0.5926 0.8425 #17 GroupNF 5 11 146.8182 0.5948 0.0001 0.2383 0.4408 0.7307 #18 GroupNF 6 11 133.5000 0.5407 -0.0018 0.1531 0.4208 0.6555 #19 GroupNM 1 8 126.7500 0.5132 -0.0005 0.3339 0.3422 0.6810 #20 GroupNM 2 8 168.6250 0.6834 0.0005 0.2855 0.5021 0.8196 #21 GroupNM 3 8 176.5000 0.7154 0.0016 0.3400 0.5090 0.8555 #22 GroupNM 4 8 172.5625 0.6994 0.0013 0.3102 0.5066 0.8376 #23 GroupNM 5 8 150.0000 0.6077 -0.0003 0.3585 0.4175 0.7683 #24 GroupNM 6 8 122.8125 0.4972 -0.0025 0.2469 0.3502 0.6447
## Example with the "Shoulder tip pain study" data ## data(shoulder) attach(shoulder) group<-paste(group1, group2, sep="") ex.ci<-ld.ci(y=resp, time=time, subject=subject, group=group, alpha=0.05, time.name="Time", group.name="Group", description=FALSE, time.order=c(1,2,3,4,5,6), group.order=c("YF","YM","NF","NM")) # LD CI Calculations # ----------------------- # Order of the time and group levels. # Time level: 1 2 3 4 5 6 # Group level: YF YM NF NM # The order may be specified in time.order or group.order. ## Summary of the output ex.ci # Group Time Nobs RankMeans RTE Bias Variance Lower Upper #1 GroupYF 1 14 123.9643 0.5019 0.0008 0.1680 0.3792 0.6243 #2 GroupYF 2 14 100.2857 0.4056 0.0003 0.1366 0.3000 0.5222 #3 GroupYF 3 14 89.2500 0.3608 -0.0005 0.0979 0.2722 0.4615 #4 GroupYF 4 14 101.4643 0.4104 0.0000 0.1136 0.3131 0.5164 #5 GroupYF 5 14 72.1071 0.2911 -0.0004 0.0389 0.2351 0.3554 #6 GroupYF 6 14 84.3214 0.3407 -0.0002 0.0808 0.2605 0.4329 #7 GroupYM 1 8 107.4375 0.4347 -0.0002 0.3093 0.2786 0.6060 #8 GroupYM 2 8 113.4375 0.4591 0.0002 0.2607 0.3120 0.6142 #9 GroupYM 3 8 87.3750 0.3532 0.0001 0.1464 0.2471 0.4774 #10 GroupYM 4 8 76.6875 0.3097 0.0002 0.0873 0.2277 0.4070 #11 GroupYM 5 8 92.0625 0.3722 -0.0001 0.2011 0.2487 0.5167 #12 GroupYM 6 8 92.0625 0.3722 -0.0001 0.2011 0.2487 0.5167 #13 GroupNF 1 11 154.3636 0.6255 0.0004 0.2954 0.4500 0.7708 #14 GroupNF 2 11 174.3636 0.7068 0.0007 0.1890 0.5573 0.8188 #15 GroupNF 3 11 162.4545 0.6584 -0.0001 0.1941 0.5130 0.7768 #16 GroupNF 4 11 182.2273 0.7387 0.0007 0.1704 0.5926 0.8425 #17 GroupNF 5 11 146.8182 0.5948 0.0001 0.2383 0.4408 0.7307 #18 GroupNF 6 11 133.5000 0.5407 -0.0018 0.1531 0.4208 0.6555 #19 GroupNM 1 8 126.7500 0.5132 -0.0005 0.3339 0.3422 0.6810 #20 GroupNM 2 8 168.6250 0.6834 0.0005 0.2855 0.5021 0.8196 #21 GroupNM 3 8 176.5000 0.7154 0.0016 0.3400 0.5090 0.8555 #22 GroupNM 4 8 172.5625 0.6994 0.0013 0.3102 0.5066 0.8376 #23 GroupNM 5 8 150.0000 0.6077 -0.0003 0.3585 0.4175 0.7683 #24 GroupNM 6 8 122.8125 0.4972 -0.0025 0.2469 0.3502 0.6447
This function performs several tests for the relative treatment effects with global or patterned alternatives for the LD-F1 design (see Details for the definition). For the experiments with LD-F1 design, the Wald-type statistic (WTS), Hotelling's F (T-squared) statistic, and the ANOVA-type statistic (ATS) are calculated for the global alternatives. The hypothesis can also be tested against patterned alternatives to detect various trends. For the design with two time points where no data are missing, tests under Behrens-Fisher and homogeneous variance situations can be performed.
ld.f1(y, time, subject, w.pat=NULL, time.name="Time", description=TRUE, time.order=NULL, plot.RTE=TRUE, show.covariance=FALSE, order.warning=TRUE)
ld.f1(y, time, subject, w.pat=NULL, time.name="Time", description=TRUE, time.order=NULL, plot.RTE=TRUE, show.covariance=FALSE, order.warning=TRUE)
y |
a vector of numeric variable of interest; missing values should be specified as NA. |
time |
a vector of the sub-plot factor variable. See Details for more explanation. |
subject |
a vector of individual subjects |
w.pat |
a vector of pattern for the pattern alternatives; the default option is NULL. The length, if specified, must be equal to the number of time levels. |
time.name |
a character vector specifying the name of the time vector; the default option is "Time". |
description |
an indicator for whether a short description of the output should be shown; the default option is TRUE. |
time.order |
a character or numeric vector specifying the order of the time levels; the default option is NULL, in which case, the levels are in the order of the original data. |
plot.RTE |
an indicator for whether a plot of the relative treatment effect (RTE) should be shown; the default option is TRUE. |
show.covariance |
an indicator for whether the covariance matrix should be shown; the default option is FALSE, in which case, NULL is returned. |
order.warning |
an indicator for whether a short description of the warning regarding the ordering of factors should be shown; the default option is TRUE. |
The LD-F1 design refers to the experimental design with one sub-plot factor (longitudinal data for one homogeneous group of subjects). A sub-plot factor refers to a factor effective at a single time point for all time curves and all subjects. See Brunner et al. (2002) for more examples.
A list with the following numeric components.
RTE |
summary of the relative treatment effect (RTE) in a n-by-3 matrix form, where n is the number of time vector levels; the summary includes the mean of the ranks (RankMeans) in the 1st column, number of observations without counting the repeated measurements within the cell (Nobs) in the 2nd column, and the relative treatment effect (RTE) in the 3rd column. |
Wald.test |
the test statistic, degrees of freedom (df) for the central chi-square distribution, and corresponding p-value of the Wald-type test. |
Hotelling.test |
the test statistic, numerator and denominator degrees of freedom (df1, df2), respectively, for the central F distribution, and corresponding p-value of the Hotelling's F (T-squared) test. |
ANOVA.test |
the test statistic, numerator degrees of freedom (df) for the central F distribution, and corresponding p-value of the ANOVA-type test; denominator degrees of freedom is set to infinity. |
two.sample.test |
the test statistic and corresponding p-values (approximated by standard normal and Student's t distributions) of the test under homogeneous variance situation. |
two.sample.BF.test |
the test statistic and corresponding p-values (approximated by standard normal (N) and Student's t distributions (T)) of the test under the Behrens-Fisher situation where variances of the two samples are not assumed to be equal. |
pattern.test |
the test statistic and corresponding p-values (approximated by standard normal (N) and Student's t distributions (T)) of the test with patterned alternatives where the patterns are specified by w.pat. |
covariance |
the covariance matrix. |
model.name |
the name of the model used. |
If there are more than two time points in the data, or if there is a missing observation, two.sample.test and two.sample.BF.test return NULL. If the denominator degrees of freedom (df2) is less than 1, Hotelling.test returns NULL.
Kimihiro Noguchi, Mahbub Latif, Frank Konietschke, Yulia Gel, Edgar Brunner
Brunner, E., Domhof, S., and Langer, F. (2002). Nonparametric Analysis of Longitudinal Data in Factorial Experiments,
Wiley, New York.
Brunner, E. and Langer, F. (1999). Nichtparametrische Analyse longitudinaler Daten,
R. Oldenbourg Verlag, Munchen Wien.
Noguchi, K., Gel, Y.R., Brunner, E., and Konietschke, F. (2012). nparLD: An R Software Package for the Nonparametric Analysis of Longitudinal Data in Factorial Experiments. Journal of Statistical Software, 50(12), 1-23.
nparLD
, ld.f2
, f1.ld.f1
,
f1.ld.f2
, f2.ld.f1
, ld.ci
,
panic
## Example with the "Panic disorder study I" data ## data(panic) attach(panic) w.pat<-c(5,4,3,2,5) ex.f1<-ld.f1(y=resp, time=time, subject=subject, w.pat=w.pat, time.name="Week", description=FALSE, time.order=c(0,2,4,6,8)) # LD F1 Model # ----------------------- # Check that the order of the time level is correct. # Time level: 0 2 4 6 8 # If the order is not correct, specify the correct order in time.order. ## Wald-type statistic ex.f1$Wald.test # Statistic df p-value #Week 126.6946 4 1.9822e-26 ## ANOVA-type statistic ex.f1$ANOVA.test # Statistic df p-value #Week 36.93664 2.234135 1.975781e-18
## Example with the "Panic disorder study I" data ## data(panic) attach(panic) w.pat<-c(5,4,3,2,5) ex.f1<-ld.f1(y=resp, time=time, subject=subject, w.pat=w.pat, time.name="Week", description=FALSE, time.order=c(0,2,4,6,8)) # LD F1 Model # ----------------------- # Check that the order of the time level is correct. # Time level: 0 2 4 6 8 # If the order is not correct, specify the correct order in time.order. ## Wald-type statistic ex.f1$Wald.test # Statistic df p-value #Week 126.6946 4 1.9822e-26 ## ANOVA-type statistic ex.f1$ANOVA.test # Statistic df p-value #Week 36.93664 2.234135 1.975781e-18
This function performs several tests for the relative treatment effects for the LD-F2 design (see Details for the definition). The Wald-type statistic (WTS) and the ANOVA-type statistic (ATS) are calculated for each of the two sub-plot factors as well as their interaction.
ld.f2(y, time1, time2, subject, time1.name="Treatment", time2.name="Time", description=TRUE, time1.order=NULL, time2.order=NULL, plot.RTE=TRUE, show.covariance=FALSE, order.warning=TRUE)
ld.f2(y, time1, time2, subject, time1.name="Treatment", time2.name="Time", description=TRUE, time1.order=NULL, time2.order=NULL, plot.RTE=TRUE, show.covariance=FALSE, order.warning=TRUE)
y |
a vector of numeric variable of interest; missing values should be specified as NA. |
time1 |
a vector of the first sub-plot factor variable. See Details for more explanation. |
time2 |
a vector of the second sub-plot factor variable. See Details for more explanation. |
subject |
a vector of individual subjects. |
time1.name |
a character vector specifying the name of the time1 vector; the default option is "Treatment". |
time2.name |
a character vector specifying the name of the time2 vector; the default option is "Time". |
description |
an indicator for whether a short description of the output should be shown; the default option is TRUE. |
time1.order |
a character or numeric vector specifying the order of the time1 levels; the default option is NULL, in which case, the levels are in the order of the original data. |
time2.order |
a character or numeric vector specifying the order of the time2 levels; the default option is NULL, in which case, the levels are in the order of the original data. |
plot.RTE |
an indicator for whether a plot of the relative treatment effect (RTE) should be shown; the default option is TRUE. |
show.covariance |
an indicator for whether the covariance matrix should be shown; the default option is FALSE, in which case, NULL is returned. |
order.warning |
an indicator for whether a short description of the warning regarding the ordering of factors should be shown; the default option is TRUE. |
The LD-F2 design refers to the experimental design with two sub-plot factors (longitudinal data for one homogeneous group of subjects and an underlying structure in the time where time2 is the stratification of time1). A sub-plot factor refers to a factor effective at a single time point for all time curves and all subjects. See Brunner et al. (2002) for more examples.
A list with the following numeric components.
RTE |
summary of the relative treatment effect (RTE) in a n-by-3 matrix form, where n is the total of number of time1 and time2 levels, and their interactions; the summary includes the mean of the ranks (RankMeans) in the 1st column, number of observations without counting the repeated measurements within the cell (Nobs) in the 2nd column, and the relative treatment effect (RTE) in the 3rd column. |
Wald.test |
the test statistic, degrees of freedom (df) for the central chi-square distribution, and corresponding p-value of the Wald-type test. |
ANOVA.test |
the test statistic, numerator degrees of freedom (df) for the central F distribution, and corresponding p-value of the ANOVA-type test; denominator degrees of freedom is set to infinity. |
covariance |
the covariance matrix. |
model.name |
the name of the model used. |
Version 1.0 of the ld.f2 function had problems with calculations of the statistics, and the issues have been resolved in Version 1.1. We would like to thank Dr. Stefano Burigat for pointing out the problems.
Kimihiro Noguchi, Karthinathan Thangavelu, Frank Konietschke, Yulia Gel, Edgar Brunner
Brunner, E., Domhof, S., and Langer, F. (2002). Nonparametric Analysis of Longitudinal Data in Factorial Experiments,
Wiley, New York.
Brunner, E. and Langer, F. (1999). Nichtparametrische Analyse longitudinaler Daten,
R. Oldenbourg Verlag, Munchen Wien.
Noguchi, K., Gel, Y.R., Brunner, E., and Konietschke, F. (2012). nparLD: An R Software Package for the Nonparametric Analysis of Longitudinal Data in Factorial Experiments. Journal of Statistical Software, 50(12), 1-23.
nparLD
, ld.f1
, f1.ld.f1
,
f1.ld.f2
, f2.ld.f1
, ld.ci
,
amylase
## Example with the "Alpha-amylase study" data ## data(amylase) attach(amylase) ex.f2<-ld.f2(y=resp, time1=time1, time2=time2, subject=subject, time1.name="Day", time2.name="Time", description=FALSE, time1.order=c("M","T"), time2.order=c(8,12,17,21)) # LD F2 Model # ----------------------- # Check that the order of the time1 and time2 levels are correct. # Time1 level: M T # Time2 level: 8 12 17 21 # If the order is not correct, specify the correct order in time1.order and # time2.order. ## Wald-type statistic ex.f2$Wald.test # Statistic df p-value #Day 0.6761043 1 4.109314e-01 #Time 35.8647640 3 7.997949e-08 #Day:Time 14.3020921 3 2.521503e-03 ## ANOVA-type statistic ex.f2$ANOVA.test # Statistic df p-value #Day 0.6761043 1.000000 4.109314e-01 #Time 14.2671950 2.858344 5.860479e-09 #Day:Time 5.2242782 2.184249 4.150298e-03
## Example with the "Alpha-amylase study" data ## data(amylase) attach(amylase) ex.f2<-ld.f2(y=resp, time1=time1, time2=time2, subject=subject, time1.name="Day", time2.name="Time", description=FALSE, time1.order=c("M","T"), time2.order=c(8,12,17,21)) # LD F2 Model # ----------------------- # Check that the order of the time1 and time2 levels are correct. # Time1 level: M T # Time2 level: 8 12 17 21 # If the order is not correct, specify the correct order in time1.order and # time2.order. ## Wald-type statistic ex.f2$Wald.test # Statistic df p-value #Day 0.6761043 1 4.109314e-01 #Time 35.8647640 3 7.997949e-08 #Day:Time 14.3020921 3 2.521503e-03 ## ANOVA-type statistic ex.f2$ANOVA.test # Statistic df p-value #Day 0.6761043 1.000000 4.109314e-01 #Time 14.2671950 2.858344 5.860479e-09 #Day:Time 5.2242782 2.184249 4.150298e-03
This function performs several nonparametric tests for the relative treatment effects with global alternatives for repeated measures data in various factorial designs (see Details for the designs). For such data, the Wald-type statistic (WTS) and the ANOVA-type statistic (ATS) are calculated (see On the Test Statistics for details of the test staistics). The methods are available for the LD-F1, LD-F2, F1-LD-F1, F1-LD-F2, and F2-LD-F1 designs.
nparLD(formula, data=NULL, subject, description=TRUE, time1.order=NULL, time2.order=NULL, group1.order=NULL, group2.order=NULL, plot.CI=FALSE, alpha=0.05, show.covariance=FALSE, order.warning=TRUE)
nparLD(formula, data=NULL, subject, description=TRUE, time1.order=NULL, time2.order=NULL, group1.order=NULL, group2.order=NULL, plot.CI=FALSE, alpha=0.05, show.covariance=FALSE, order.warning=TRUE)
formula |
a model |
data |
a data.frame, list or environment (or object coercible by |
subject |
the column number in |
description |
an indicator for whether a short description of the output should be shown; the default option is TRUE. |
time1.order |
a character or numeric vector specifying the order of the time1 levels; applicable to all designs. |
time2.order |
a character or numeric vector specifying the order of the time2 levels; applicable to the LD-F2 and F1-LD-F2 designs. |
group1.order |
a character or numeric vector specifying the order of the group1 levels; applicable to the F1-LD-F1 and F1-LD-F2 designs. |
group2.order |
a character or numeric vector specifying the order of the group2 levels; applicable to the F2-LD-F1 design. |
plot.CI |
an indicator for whether a plot of the confidence interval (CI) for the relative treatment effect (RTE) should be shown; the default option is FALSE. |
alpha |
a numeric specifying the significance level of the confidence intervals; the default option is 0.05. |
show.covariance |
an indicator for whether the covariance matrix should be shown; the default option is FALSE, in which case, NULL is returned. |
order.warning |
an indicator for whether a short description of the warning regarding the ordering of factors should be shown; the default option is TRUE. |
The Fx-LD-Fy design refers to the experimental design with x whole-plot factor and y sub-plot factors. A whole-plot (between-subjects) factor refers to a factor effective for each subject at all times. A sub-plot (within-subjects) factor refers to a factor effective at a single time point for all time curves and all subjects. The LD-Fy design refers to the experimental design with no whole-plot factor. See Brunner et al. (2002) for more examples. Also see print
, plot
, and summary
for summarized outputs.
An nparLD
class object with the following components.
RTE |
summary of the relative treatment effect (RTE) in a n-by-3 matrix form, where n is the total number of time1, time2, and group levels, and group-time interactions; the summary includes the mean of the ranks (RankMeans) in the 1st column, number of observations without counting the repeated measurements within the cell (Nobs) in the 2nd column, and the relative treatment effect (RTE) in the 3rd column. |
Wald.test |
the test statistic, the degrees of freedom (df) of the central chi-squared distribution, and the corresponding p-value of the Wald-type test. |
ANOVA.test |
the test statistic, the numerator degrees of freedom (df) of the central F distribution, and the corresponding p-value of the ANOVA-type test; the denominator degrees of freedom is set to infinity. |
covariance |
the covariance matrix. |
Conf.Int |
the (pointwise) 100(1-alpha) percent confidence intervals. See |
... |
Other function-specific outputs. For example, |
Although we provide both Wald-type statistic (WTS, see Wald.test
) and ANOVA-type statistic with the denominator degrees of freedom set to infinity (ATS, see ANOVA.test
), ATS is typically preferred to WTS as it requires less assumptions on the covariance matrix and it has superior small sample performances. Moreover, for the main effects and interactions involving only the whole-plot factors, the modified ANOVA-type statistic with Box (1954) approximation (ANOVA.test.mod.Box
) is preferred to ATS. See Brunner et al. (2002) for more details.
Kimihiro Noguchi, Karthinathan Thangavelu, Frank Konietschke, Yulia Gel, Edgar Brunner
Box, G.E.P. (1954). Some theorems on quadratic forms applied in the study of analysis of variance problems, I. Effect of inequality of variance in the one-way classification. Annals of Mathematical Statistics, 25, 290-302.
Brunner, E., Domhof, S., and Langer, F. (2002). Nonparametric Analysis of Longitudinal Data in Factorial Experiments,
Wiley, New York.
Brunner, E. and Langer, F. (1999). Nichtparametrische Analyse longitudinaler Daten,
R. Oldenbourg Verlag, Munchen Wien.
Noguchi, K., Gel, Y.R., Brunner, E., and Konietschke, F. (2012). nparLD: An R Software Package for the Nonparametric Analysis of Longitudinal Data in Factorial Experiments. Journal of Statistical Software, 50(12), 1-23.
ld.f1
, ld.f2
, f1.ld.f1
, f1.ld.f2
, f2.ld.f1
, ld.ci
, amylase
, edema
, shoulder
, tree
, panic
, panic2
, plasma
, dental
, rat
, respiration
, print
, plot
, summary
## Example with the "Panic disorder study I" data (LD-F1 design) ## data(panic) ex.f1.np<-nparLD(resp~time, data=panic, subject="subject", description=FALSE) # LD F1 Model # ----------------------- # Check that the order of the time level is correct. # Time level: 0 2 4 6 8 # If the order is not correct, specify the correct order in time.order. ex.f1.np$Wald.test # Statistic df p-value #time 126.6946 4 1.9822e-26 ex.f1.np$ANOVA.test # Statistic df p-value #time 36.93664 2.234135 1.975781e-18 ## Example with the "Alpha-amylase study" data (LD-F2 design) ## data(amylase) ex.f2.np<-nparLD(resp~time1*time2, data=amylase, subject="subject", description=FALSE) # LD F2 Model # ----------------------- # Check that the order of the time1 and time2 levels are correct. # Time1 level: M T # Time2 level: 8 12 17 21 # If the order is not correct, specify the correct order in time1.order or # time2.order. ex.f2.np$Wald.test # Statistic df p-value #time1 0.6761043 1 4.109314e-01 #time2 35.8647640 3 7.997949e-08 #time1:time2 14.3020921 3 2.521503e-03 ex.f2.np$ANOVA.test # Statistic df p-value #time1 0.6761043 1.000000 4.109314e-01 #time2 14.2671950 2.858344 5.860479e-09 #time1:time2 5.2242782 2.184249 4.150298e-03 ## Example with the "Vitality of treetops" data (F1-LD-F1 design) ## data(tree) ex.f1f1.np<-nparLD(resp~time*group, data=tree, subject="subject", description=FALSE) # F1 LD F1 Model # ----------------------- # Check that the order of the time and group levels are correct. # Time level: 1 2 3 4 # Group level: D2 D0 D1 # If the order is not correct, specify the correct order in time.order or # group.order. ex.f1f1.np$Wald.test # Statistic df p-value #group 4.510037 2 1.048716e-01 #time 58.061097 3 1.525356e-12 #group:time 14.819966 6 2.170415e-02 ex.f1f1.np$ANOVA.test # Statistic df p-value #group 2.352854 1.968147 9.601181e-02 #time 21.389142 2.729147 8.210954e-13 #group:time 3.113632 5.346834 6.768732e-03 ex.f1f1.np$ANOVA.test.mod.Box # Statistic df1 df2 p-value #group 2.352854 1.968147 64.3979 0.1040525 ## Example with the "Postoperative edema" data (F1-LD-F2 design) ## data(edema) ex.f1f2.np<-nparLD(resp~group*time1*time2, data=edema, subject="subject", description=FALSE) # F1 LD F2 Model # ----------------------- # Check that the order of the time1, time2, and group levels are correct. # Time1 level: Healthy Operated # Time2 level: -1 1 3 5 # Group level: Drug Placebo # If the order is not correct, specify the correct order in time1.order, # time2.order, or group.order. ex.f1f2.np$Wald.test # Statistic df p-value #group 1.0725762 1 3.003643e-01 #time1 25.8758257 1 3.641005e-07 #time2 36.8857947 3 4.864630e-08 #group:time1 0.3304448 1 5.653973e-01 #time2:time1 47.3460508 3 2.933702e-10 #group:time2 5.3048189 3 1.507900e-01 #group:time1:time2 1.6581652 3 6.462743e-01 ex.f1f2.np$ANOVA.test # Statistic df p-value #group 1.0725762 1.000000 3.003643e-01 #time1 25.8758257 1.000000 3.641005e-07 #time2 11.0630080 2.699667 9.661602e-07 #group:time1 0.3304448 1.000000 5.653973e-01 #time2:time1 15.1854889 2.630202 6.184646e-09 #group:time2 1.3342605 2.699667 2.625538e-01 #group:time1:time2 0.7170325 2.630202 5.242367e-01 ## Example with the "Shoulder tip pain study" data (F2-LD-F1 design) ## data(shoulder) ex.f2f1.np<-nparLD(resp~time*group1*group2, data=shoulder, subject="subject", description=FALSE) # F2 LD F1 Model # ----------------------- # Check that the order of the time, group1, and group2 levels are correct. # Time level: 1 2 3 4 5 6 # Group1 level: Y N # Group2 level: F M # If the order is not correct, specify the correct order in time.order, # group1.order, or group2.order. # # # Warning(s): # The covariance matrix is singular. ex.f2f1.np$Wald.test # Statistic df p-value #group1 16.40129021 1 5.125033e-05 #group2 0.04628558 1 8.296575e-01 #time 16.34274332 5 5.930698e-03 #group1:group2 0.03583558 1 8.498554e-01 #group1:time 27.51450085 5 4.527996e-05 #group2:time 12.37903186 5 2.994753e-02 #group1:group2:time 5.11864769 5 4.015727e-01 ex.f2f1.np$ANOVA.test # Statistic df p-value #group1 16.40129021 1.000000 5.125033e-05 #group2 0.04628558 1.000000 8.296575e-01 #time 3.38218704 2.700754 2.120366e-02 #group1:group2 0.03583558 1.000000 8.498554e-01 #group1:time 3.71077200 2.700754 1.398190e-02 #group2:time 1.14434841 2.700754 3.272967e-01 #group1:group2:time 0.43755394 2.700754 7.054255e-01 ex.f2f1.np$ANOVA.test.mod.Box # Statistic df1 df2 p-value #group1 16.40129021 1 21.86453 0.0005395379 #group2 0.04628558 1 21.86453 0.8316516274 #group1:group2 0.03583558 1 21.86453 0.8516017168
## Example with the "Panic disorder study I" data (LD-F1 design) ## data(panic) ex.f1.np<-nparLD(resp~time, data=panic, subject="subject", description=FALSE) # LD F1 Model # ----------------------- # Check that the order of the time level is correct. # Time level: 0 2 4 6 8 # If the order is not correct, specify the correct order in time.order. ex.f1.np$Wald.test # Statistic df p-value #time 126.6946 4 1.9822e-26 ex.f1.np$ANOVA.test # Statistic df p-value #time 36.93664 2.234135 1.975781e-18 ## Example with the "Alpha-amylase study" data (LD-F2 design) ## data(amylase) ex.f2.np<-nparLD(resp~time1*time2, data=amylase, subject="subject", description=FALSE) # LD F2 Model # ----------------------- # Check that the order of the time1 and time2 levels are correct. # Time1 level: M T # Time2 level: 8 12 17 21 # If the order is not correct, specify the correct order in time1.order or # time2.order. ex.f2.np$Wald.test # Statistic df p-value #time1 0.6761043 1 4.109314e-01 #time2 35.8647640 3 7.997949e-08 #time1:time2 14.3020921 3 2.521503e-03 ex.f2.np$ANOVA.test # Statistic df p-value #time1 0.6761043 1.000000 4.109314e-01 #time2 14.2671950 2.858344 5.860479e-09 #time1:time2 5.2242782 2.184249 4.150298e-03 ## Example with the "Vitality of treetops" data (F1-LD-F1 design) ## data(tree) ex.f1f1.np<-nparLD(resp~time*group, data=tree, subject="subject", description=FALSE) # F1 LD F1 Model # ----------------------- # Check that the order of the time and group levels are correct. # Time level: 1 2 3 4 # Group level: D2 D0 D1 # If the order is not correct, specify the correct order in time.order or # group.order. ex.f1f1.np$Wald.test # Statistic df p-value #group 4.510037 2 1.048716e-01 #time 58.061097 3 1.525356e-12 #group:time 14.819966 6 2.170415e-02 ex.f1f1.np$ANOVA.test # Statistic df p-value #group 2.352854 1.968147 9.601181e-02 #time 21.389142 2.729147 8.210954e-13 #group:time 3.113632 5.346834 6.768732e-03 ex.f1f1.np$ANOVA.test.mod.Box # Statistic df1 df2 p-value #group 2.352854 1.968147 64.3979 0.1040525 ## Example with the "Postoperative edema" data (F1-LD-F2 design) ## data(edema) ex.f1f2.np<-nparLD(resp~group*time1*time2, data=edema, subject="subject", description=FALSE) # F1 LD F2 Model # ----------------------- # Check that the order of the time1, time2, and group levels are correct. # Time1 level: Healthy Operated # Time2 level: -1 1 3 5 # Group level: Drug Placebo # If the order is not correct, specify the correct order in time1.order, # time2.order, or group.order. ex.f1f2.np$Wald.test # Statistic df p-value #group 1.0725762 1 3.003643e-01 #time1 25.8758257 1 3.641005e-07 #time2 36.8857947 3 4.864630e-08 #group:time1 0.3304448 1 5.653973e-01 #time2:time1 47.3460508 3 2.933702e-10 #group:time2 5.3048189 3 1.507900e-01 #group:time1:time2 1.6581652 3 6.462743e-01 ex.f1f2.np$ANOVA.test # Statistic df p-value #group 1.0725762 1.000000 3.003643e-01 #time1 25.8758257 1.000000 3.641005e-07 #time2 11.0630080 2.699667 9.661602e-07 #group:time1 0.3304448 1.000000 5.653973e-01 #time2:time1 15.1854889 2.630202 6.184646e-09 #group:time2 1.3342605 2.699667 2.625538e-01 #group:time1:time2 0.7170325 2.630202 5.242367e-01 ## Example with the "Shoulder tip pain study" data (F2-LD-F1 design) ## data(shoulder) ex.f2f1.np<-nparLD(resp~time*group1*group2, data=shoulder, subject="subject", description=FALSE) # F2 LD F1 Model # ----------------------- # Check that the order of the time, group1, and group2 levels are correct. # Time level: 1 2 3 4 5 6 # Group1 level: Y N # Group2 level: F M # If the order is not correct, specify the correct order in time.order, # group1.order, or group2.order. # # # Warning(s): # The covariance matrix is singular. ex.f2f1.np$Wald.test # Statistic df p-value #group1 16.40129021 1 5.125033e-05 #group2 0.04628558 1 8.296575e-01 #time 16.34274332 5 5.930698e-03 #group1:group2 0.03583558 1 8.498554e-01 #group1:time 27.51450085 5 4.527996e-05 #group2:time 12.37903186 5 2.994753e-02 #group1:group2:time 5.11864769 5 4.015727e-01 ex.f2f1.np$ANOVA.test # Statistic df p-value #group1 16.40129021 1.000000 5.125033e-05 #group2 0.04628558 1.000000 8.296575e-01 #time 3.38218704 2.700754 2.120366e-02 #group1:group2 0.03583558 1.000000 8.498554e-01 #group1:time 3.71077200 2.700754 1.398190e-02 #group2:time 1.14434841 2.700754 3.272967e-01 #group1:group2:time 0.43755394 2.700754 7.054255e-01 ex.f2f1.np$ANOVA.test.mod.Box # Statistic df1 df2 p-value #group1 16.40129021 1 21.86453 0.0005395379 #group2 0.04628558 1 21.86453 0.8316516274 #group1:group2 0.03583558 1 21.86453 0.8516017168
Measurements of the degree of illness on a CGI scale for a group of patients suffering from panic disorder and agoraphobia.
data(panic)
data(panic)
Longitudinal data of 16 patients with CGI scores taken on 5 occasions.
A group of 16 patients from panic disorder and agoraphobia were treated with anti-depressant imipramin over a period of eight weeks. Measurements on a discrete scale of scores between 2 and 8 were taken (2=not ill through 8=extremely ill) on 5 occasions (0=baseline, 2=after two weeks, 4=after four weeks,...).
Brunner, E., Domhof, S., and Langer, F. (2002). Nonparametric Analysis of Longitudinal Data in Factorial Experiments,
Wiley, New York.
Brunner, E. and Langer, F. (1999). Nichtparametrische Analyse longitudinaler Daten,
R. Oldenbourg Verlag, Munchen Wien.
Noguchi, K., Gel, Y.R., Brunner, E., and Konietschke, F. (2012). nparLD: An R Software Package for the Nonparametric Analysis of Longitudinal Data in Factorial Experiments. Journal of Statistical Software, 50(12), 1-23.
## Analysis using LD-F1 design ## data(panic) attach(panic) w.pat<-c(5,4,3,2,5) ex.f1<-ld.f1(y=resp, time=time, subject=subject, w.pat=w.pat, time.name="Week", description=FALSE) # LD F1 Model # ----------------------- # Check that the order of the time level is correct. # Time level: 0 2 4 6 8 # If the order is not correct, specify the correct order in time.order. ## Wald-type statistic ex.f1$Wald.test # Statistic df p-value #Week 126.6946 4 1.9822e-26 ## ANOVA-type statistic ex.f1$ANOVA.test # Statistic df p-value #Week 36.93664 2.234135 1.975781e-18
## Analysis using LD-F1 design ## data(panic) attach(panic) w.pat<-c(5,4,3,2,5) ex.f1<-ld.f1(y=resp, time=time, subject=subject, w.pat=w.pat, time.name="Week", description=FALSE) # LD F1 Model # ----------------------- # Check that the order of the time level is correct. # Time level: 0 2 4 6 8 # If the order is not correct, specify the correct order in time.order. ## Wald-type statistic ex.f1$Wald.test # Statistic df p-value #Week 126.6946 4 1.9822e-26 ## ANOVA-type statistic ex.f1$ANOVA.test # Statistic df p-value #Week 36.93664 2.234135 1.975781e-18
Measurements of the degree of illness on a P&A scale for a group of patients suffering from panic disorder with or without agoraphobia.
data(panic2)
data(panic2)
Longitudinal data of 37 patients with P&A scores taken on 5 occasions.
A group of 37 patients with a panic disorder with/without agoraphobia was treated with anti-depressant imipramin over a period of eight weeks. The severity of the panic disorder was determined at five different occasions in increments of two weeks (0=baseline, 2=after two weeks, 4=after four weeks,...) using the new P&A scale (Bandelow, 1995, 1999), a discrete scale assigning to each patient a value between 0 and 52. Aim of this study was to determine whether a patient's improvement as measured by the P&A scale was different depending on whether or not the patient suffered from agoraphobia (w=with agoraphobia, wo=without agoraphobia).
Bandelow, B. (1995). Assessing the efficacy of treatments for panic disorder and agoraphobia, II. The Panic and Agoraphobia Scale. International Journal of Clinical Psychopharmacology 10, 73 2.
Bandelow, B. (1999). Panic and Agoraphobia Scale (PAS). Hogrefe & Huber, Goettingen.
Brunner, E., Domhof, S., and Langer, F. (2002). Nonparametric Analysis of Longitudinal Data in Factorial Experiments,
Wiley, New York.
Brunner, E. and Langer, F. (1999). Nichtparametrische Analyse longitudinaler Daten,
R. Oldenbourg Verlag, Munchen Wien.
Noguchi, K., Gel, Y.R., Brunner, E., and Konietschke, F. (2012). nparLD: An R Software Package for the Nonparametric Analysis of Longitudinal Data in Factorial Experiments. Journal of Statistical Software, 50(12), 1-23.
## Analysis using F1-LD-F1 design ## data(panic2) attach(panic2) w.t<-c(1:5) w.g<-c(1:2) w.pat<-rbind(c(1:5), c(1:5)) ex.f1f1.2<-f1.ld.f1(y=resp, time=time, group=group, subject=subject, w.pat=w.pat, w.t=w.t, w.g=w.g, time.name="Week", group.name="Agoraphobia", description=FALSE) # F1 LD F1 Model # ----------------------- # Check that the order of the time and group levels are correct. # Time level: 0 2 4 6 8 # Group level: w wo # If the order is not correct, specify the correct order in time.order or # group.order. ## Wald-type statistic ex.f1f1.2$Wald.test # Statistic df p-value #Agoraphobia 8.427367 1 3.696152e-03 #Week 119.793400 4 5.912722e-25 #Agoraphobia:Week 13.493440 4 9.100275e-03 ## ANOVA-type statistic ex.f1f1.2$ANOVA.test # Statistic df p-value #Agoraphobia 8.427367 1.000000 3.696152e-03 #Week 32.089272 2.693506 7.109822e-19 #Agoraphobia:Week 1.751998 2.693506 1.599706e-01 ## ANOVA-type statistic for the whole-plot factor ex.f1f1.2$ANOVA.test.mod.Box # Statistic df1 df2 p-value #Agoraphobia 8.427367 1 28.62587 0.007044246
## Analysis using F1-LD-F1 design ## data(panic2) attach(panic2) w.t<-c(1:5) w.g<-c(1:2) w.pat<-rbind(c(1:5), c(1:5)) ex.f1f1.2<-f1.ld.f1(y=resp, time=time, group=group, subject=subject, w.pat=w.pat, w.t=w.t, w.g=w.g, time.name="Week", group.name="Agoraphobia", description=FALSE) # F1 LD F1 Model # ----------------------- # Check that the order of the time and group levels are correct. # Time level: 0 2 4 6 8 # Group level: w wo # If the order is not correct, specify the correct order in time.order or # group.order. ## Wald-type statistic ex.f1f1.2$Wald.test # Statistic df p-value #Agoraphobia 8.427367 1 3.696152e-03 #Week 119.793400 4 5.912722e-25 #Agoraphobia:Week 13.493440 4 9.100275e-03 ## ANOVA-type statistic ex.f1f1.2$ANOVA.test # Statistic df p-value #Agoraphobia 8.427367 1.000000 3.696152e-03 #Week 32.089272 2.693506 7.109822e-19 #Agoraphobia:Week 1.751998 2.693506 1.599706e-01 ## ANOVA-type statistic for the whole-plot factor ex.f1f1.2$ANOVA.test.mod.Box # Statistic df1 df2 p-value #Agoraphobia 8.427367 1 28.62587 0.007044246
Measurements of the plasma-renin activity (PRA) (in ng/ml/h) for agroup of healthy non-smokers aged 21-30 years
data(plasma)
data(plasma)
Longitudinal data of 49 subjects with PRA measurements taken on 5 occasions.
In a randomized, controlled study of 49 subjects (healthy non-smokers, aged 21-30 years) 750 ml of blood was removed and replaced with 1000 ml of a physiological electrolyte solution, together with one of four drugs (propanolol: 10 subjects, dobutamine: 13 subjects, fenoterol: 13 subjects, placebo: 13 subjects). Three of the original 13 subjects in the propanolol group fell ill and were unable to continue their participation in the study. The plasma-renin activity (PRA) was measured on five occasions (after 0, 2, 6, 8, 12 hours) and determined by means of blood test. One of the aims of the study was to analyze the extent to which PRA was increased or reduced by the drug.
Brunner, E., Domhof, S., and Langer, F. (2002). Nonparametric Analysis of Longitudinal Data in Factorial Experiments,
Wiley, New York.
Brunner, E. and Langer, F. (1999). Nichtparametrische Analyse longitudinaler Daten,
R. Oldenbourg Verlag, Munchen Wien.
Noguchi, K., Gel, Y.R., Brunner, E., and Konietschke, F. (2012). nparLD: An R Software Package for the Nonparametric Analysis of Longitudinal Data in Factorial Experiments. Journal of Statistical Software, 50(12), 1-23.
## Analysis using F1-LD-F1 design ## data(plasma) attach(plasma) w.t<-c(1:5) w.g<-c(1:4) w.pat<-rbind(c(1:5), c(1:5), c(1:5), c(1:5)) ex.f1f1.3<-f1.ld.f1(y=resp, time=time, group=group, subject=subject, w.pat=w.pat, w.t=w.t, w.g=w.g, time.name="Hour", group.name="Drug", description=FALSE) # F1 LD F1 Model # ----------------------- # Check that the order of the time and group levels are correct. # Time level: 0 2 6 8 12 # Group level: Propanolol Dobutamine Fenoterol Placebo # If the order is not correct, specify the correct order in time.order or # group.order. ## Wald-type statistic ex.f1f1.3$Wald.test # Statistic df p-value #Drug 128.6257 3 1.069606e-27 #Hour 235.4921 4 8.672886e-50 #Drug:Hour 163.9275 12 8.307977e-29 ## ANOVA-type statistic ex.f1f1.3$ANOVA.test # Statistic df p-value #Drug 23.74689 2.610248 1.113276e-13 #Hour 53.66771 3.108207 7.870535e-36 #Drug:Hour 16.03977 7.778431 2.488143e-23 ## ANOVA-type statistic for the whole-plot factor ex.f1f1.3$ANOVA.test.mod.Box # Statistic df1 df2 p-value #Drug 23.74689 2.610248 38.76767 2.207969e-08
## Analysis using F1-LD-F1 design ## data(plasma) attach(plasma) w.t<-c(1:5) w.g<-c(1:4) w.pat<-rbind(c(1:5), c(1:5), c(1:5), c(1:5)) ex.f1f1.3<-f1.ld.f1(y=resp, time=time, group=group, subject=subject, w.pat=w.pat, w.t=w.t, w.g=w.g, time.name="Hour", group.name="Drug", description=FALSE) # F1 LD F1 Model # ----------------------- # Check that the order of the time and group levels are correct. # Time level: 0 2 6 8 12 # Group level: Propanolol Dobutamine Fenoterol Placebo # If the order is not correct, specify the correct order in time.order or # group.order. ## Wald-type statistic ex.f1f1.3$Wald.test # Statistic df p-value #Drug 128.6257 3 1.069606e-27 #Hour 235.4921 4 8.672886e-50 #Drug:Hour 163.9275 12 8.307977e-29 ## ANOVA-type statistic ex.f1f1.3$ANOVA.test # Statistic df p-value #Drug 23.74689 2.610248 1.113276e-13 #Hour 53.66771 3.108207 7.870535e-36 #Drug:Hour 16.03977 7.778431 2.488143e-23 ## ANOVA-type statistic for the whole-plot factor ex.f1f1.3$ANOVA.test.mod.Box # Statistic df1 df2 p-value #Drug 23.74689 2.610248 38.76767 2.207969e-08
This function displays the plot of the relative treatment effect (RTE) at each time point with the corresponding pointwise confidence interval from nparLD
.
## S3 method for class 'nparLD' plot(x, ...)
## S3 method for class 'nparLD' plot(x, ...)
x |
an |
... |
further arguments passed to or from other methods. |
The Fx-LD-Fy design refers to the experimental design with x whole-plot factor and y sub-plot factors. A whole-plot (between-subjects) factor refers to a factor effective for each subject at all times. A sub-plot (within-subjects) factor refers to a factor effective at a single time point for all time curves and all subjects. The LD-Fy design refers to the experimental design with no whole-plot factor. See Brunner et al. (2002) for more examples.
A list with the following numeric components.
RTE |
summary of the relative treatment effect (RTE) in a n-by-3 matrix form, where n is the total number of time1, time2, and group levels, and group-time interactions; the summary includes the mean of the ranks (RankMeans) in the 1st column, number of observations without counting the repeated measurements within the cell (Nobs) in the 2nd column, and the relative treatment effect (RTE) in the 3rd column. |
Wald.test |
the test statistic, the degrees of freedom (df) of the central chi-squared distribution, and the corresponding p-value of the Wald-type test. |
ANOVA.test |
the test statistic, the numerator degrees of freedom (df) of the central F distribution, and the corresponding p-value of the ANOVA-type test; the denominator degrees of freedom is set to infinity. |
covariance |
the covariance matrix. |
Conf.Int |
the (pointwise) 100(1-alpha) percent confidence intervals. See |
... |
Other function-specific outputs. For example, |
Although we provide both Wald-type statistic (WTS, see Wald.test
) and ANOVA-type statistic with the denominator degrees of freedom set to infinity (ATS, see ANOVA.test
), ATS is typically preferred to WTS as it requires less assumptions on the covariance matrix and it has superior small sample performances. Moreover, for the main effects and interactions involving only the whole-plot factors, the modified ANOVA-type statistic with Box (1954) approximation (ANOVA.test.mod.Box
) is preferred to ATS. See Brunner et al. (2002) for more details.
Kimihiro Noguchi, Karthinathan Thangavelu, Frank Konietschke, Yulia Gel, Edgar Brunner
Box, G.E.P. (1954). Some theorems on quadratic forms applied in the study of analysis of variance problems, I. Effect of inequality of variance in the one-way classification. Annals of Mathematical Statistics, 25, 290-302.
Brunner, E., Domhof, S., and Langer, F. (2002). Nonparametric Analysis of Longitudinal Data in Factorial Experiments,
Wiley, New York.
Brunner, E. and Langer, F. (1999). Nichtparametrische Analyse longitudinaler Daten,
R. Oldenbourg Verlag, Munchen Wien.
Noguchi, K., Gel, Y.R., Brunner, E., and Konietschke, F. (2012). nparLD: An R Software Package for the Nonparametric Analysis of Longitudinal Data in Factorial Experiments. Journal of Statistical Software, 50(12), 1-23.
nparLD
, ld.f1
, ld.f2
, f1.ld.f1
, f1.ld.f2
, f2.ld.f1
, ld.ci
, amylase
, edema
, shoulder
, tree
, panic
, panic2
, plasma
, dental
, rat
, respiration
## Example with the "Panic disorder study I" data (LD-F1 design) ## data(panic) ex.f1.np<-nparLD(resp~time, data=panic, subject="subject", description=FALSE, order.warning=FALSE) plot.nparLD(ex.f1.np)
## Example with the "Panic disorder study I" data (LD-F1 design) ## data(panic) ex.f1.np<-nparLD(resp~time, data=panic, subject="subject", description=FALSE, order.warning=FALSE) plot.nparLD(ex.f1.np)
This function prints out a simple summary of the object returned by the function nparLD
. The summary includes the model, the corresponding formula, the Wald-type statistic (WTS), and the ANOVA-type statistic (ATS).
## S3 method for class 'nparLD' print(x, ...)
## S3 method for class 'nparLD' print(x, ...)
x |
an |
... |
further arguments passed to or from other methods. |
The Fx-LD-Fy design refers to the experimental design with x whole-plot factor and y sub-plot factors. A whole-plot (between-subjects) factor refers to a factor effective for each subject at all times. A sub-plot (within-subjects) factor refers to a factor effective at a single time point for all time curves and all subjects. The LD-Fy design refers to the experimental design with no whole-plot factor. See Brunner et al. (2002) for more examples.
A list with the following numeric components.
RTE |
summary of the relative treatment effect (RTE) in a n-by-3 matrix form, where n is the total number of time1, time2, and group levels, and group-time interactions; the summary includes the mean of the ranks (RankMeans) in the 1st column, number of observations without counting the repeated measurements within the cell (Nobs) in the 2nd column, and the relative treatment effect (RTE) in the 3rd column. |
Wald.test |
the test statistic, the degrees of freedom (df) of the central chi-squared distribution, and the corresponding p-value of the Wald-type test. |
ANOVA.test |
the test statistic, the numerator degrees of freedom (df) of the central F distribution, and the corresponding p-value of the ANOVA-type test; the denominator degrees of freedom is set to infinity. |
covariance |
the covariance matrix. |
Conf.Int |
the (pointwise) 100(1-alpha) percent confidence intervals. See |
... |
Other function-specific outputs. For example, |
Although we provide both Wald-type statistic (WTS, see Wald.test
) and ANOVA-type statistic with the denominator degrees of freedom set to infinity (ATS, see ANOVA.test
), ATS is typically preferred to WTS as it requires less assumptions on the covariance matrix and it has superior small sample performances. Moreover, for the main effects and interactions involving only the whole-plot factors, the modified ANOVA-type statistic with Box (1954) approximation (ANOVA.test.mod.Box
) is preferred to ATS. See Brunner et al. (2002) for more details.
Kimihiro Noguchi, Karthinathan Thangavelu, Frank Konietschke, Yulia Gel, Edgar Brunner
Box, G.E.P. (1954). Some theorems on quadratic forms applied in the study of analysis of variance problems, I. Effect of inequality of variance in the one-way classification. Annals of Mathematical Statistics, 25, 290-302.
Brunner, E., Domhof, S., and Langer, F. (2002). Nonparametric Analysis of Longitudinal Data in Factorial Experiments,
Wiley, New York.
Brunner, E. and Langer, F. (1999). Nichtparametrische Analyse longitudinaler Daten,
R. Oldenbourg Verlag, Munchen Wien.
Noguchi, K., Gel, Y.R., Brunner, E., and Konietschke, F. (2012). nparLD: An R Software Package for the Nonparametric Analysis of Longitudinal Data in Factorial Experiments. Journal of Statistical Software, 50(12), 1-23.
nparLD
, ld.f1
, ld.f2
, f1.ld.f1
, f1.ld.f2
, f2.ld.f1
, ld.ci
, amylase
, edema
, shoulder
, tree
, panic
, panic2
, plasma
, dental
, rat
, respiration
## Example with the "Panic disorder study I" data (LD-F1 design) ## data(panic) ex.f1.np<-nparLD(resp~time, data=panic, subject="subject", description=FALSE, order.warning=FALSE) print.nparLD(ex.f1.np) #Model: #LD F1 Model #Call: #resp ~ time #Relative Treatment Effect (RTE): # RankMeans Nobs RTE #time0 66.09375 16 0.8199219 #time2 50.50000 16 0.6250000 #time4 41.28125 16 0.5097656 #time6 25.62500 16 0.3140625 #time8 19.00000 16 0.2312500
## Example with the "Panic disorder study I" data (LD-F1 design) ## data(panic) ex.f1.np<-nparLD(resp~time, data=panic, subject="subject", description=FALSE, order.warning=FALSE) print.nparLD(ex.f1.np) #Model: #LD F1 Model #Call: #resp ~ time #Relative Treatment Effect (RTE): # RankMeans Nobs RTE #time0 66.09375 16 0.8199219 #time2 50.50000 16 0.6250000 #time4 41.28125 16 0.5097656 #time6 25.62500 16 0.3140625 #time8 19.00000 16 0.2312500
Measurements of body weights (in grams) of rats.
data(rat)
data(rat)
Longitudinal data of 27 rats with body weight measurements from both control and treatment groups taken over a 5-week period.
In clinical chemistry, it is important for the determination of reference intervals to investigate whether a variable of interest has a circadian rhythm. If so, the reference intervals cannot be determined independently of time. This question is to be analyzed in the case of alpha-amylase in saliva. Measurements of alpha-amylase levels were taken from the saliva of 14 volunteers, four times per day (8 a.m., 12 p.m., 5 p.m., 9 p.m.) on two days (Monday (m), Thursday (t)), since differences in the alpha-amylase profiles immediately after a weekend as opposed to the middle of the week are suspected. Thus, each subject was examined on Monday and Thursday.
Box (1950) and Wolfinger (1996) consider the growth curve problem using the body weight measurements of 27 rats. In the data, 10 rats are in the control group while the remaining 17 rats are in two treatment groups. The treatment groups with 7 and 10 rats had thyroxin and thiouracil in their drinking water, respectively. The main difficulty in modeling their growth curves is the fanning effect, which indicates an increase in variances over time. To stabilize the variances, Box (1950) considers differencing based on the data at the initial week and Wolfinger (1996) illustrates the logarithmic transformation and discusses ways to model the growth curve without relying on the data transformation.
Box, G.E.P. (1950). Problems in the analysis of growth and wear curves.
Biometrics, 6, 362-389.
Brunner, E., Domhof, S., and Langer, F. (2002). Nonparametric Analysis of Longitudinal Data in Factorial Experiments,
Wiley, New York.
Brunner, E. and Langer, F. (1999). Nichtparametrische Analyse longitudinaler Daten,
R. Oldenbourg Verlag, Munchen Wien.
Noguchi, K., Gel, Y.R., Brunner, E., and Konietschke, F. (2012).
nparLD: An R Software Package for the Nonparametric Analysis of Longitudinal Data in Factorial Experiments.
Journal of Statistical Software, 50(12), 1-23.
Wolfinger, R.D. (1996). Heterogeneous variance: covariance structures for repeated measures. Journal of Agricultural, Biological, and Environmental Statistics, 1, 205-230.
## Analysis using F1-LD-F1 design ## data(rat) attach(rat) w.pat<-matrix(rep(c(1:5),each=5),ncol=5,nrow=5) ex.f1f1<-f1.ld.f1(y=resp, time=time, group=group, subject=subject, time.name="Week", group.name="Treatment", description="FALSE", w.pat=w.pat) # F1 LD F1 Model # ----------------------- # Check that the order of the time and group levels are correct. # Time level: 0 1 2 3 4 # Group level: control thyrox thiour # If the order is not correct, specify the correct order in time.order or # group.order. ## Wald-type statistic ex.f1f1$Wald.test # Statistic df p-value #Treatment 12.52657 2 1.904977e-03 #Week 3619.03739 4 0.000000e+00 #Treatment:Week 70.34311 8 4.199050e-12 ## ANOVA-type statistic ex.f1f1$ANOVA.test # Statistic df p-value #Treatment 5.286582 1.922792 5.654723e-03 #Week 1008.512138 1.990411 0.000000e+00 #Treatment:Week 11.093940 3.516933 3.616929e-08 ## ANOVA-type statistic for the whole-plot factor ex.f1f1$ANOVA.test.mod.Box # Statistic df1 df2 p-value #Treatment 5.286582 1.922792 19.23468 0.01563658 ## The same analysis can be done using the wrapper function "nparLD" ## ex.f1f1np<-nparLD(resp~time*group, data=rat, subject="subject", description=FALSE) # F1 LD F1 Model # ----------------------- # Check that the order of the time and group levels are correct. # Time level: 0 1 2 3 4 # Group level: control thyrox thiour # If the order is not correct, specify the correct order in time.order or # group.order.
## Analysis using F1-LD-F1 design ## data(rat) attach(rat) w.pat<-matrix(rep(c(1:5),each=5),ncol=5,nrow=5) ex.f1f1<-f1.ld.f1(y=resp, time=time, group=group, subject=subject, time.name="Week", group.name="Treatment", description="FALSE", w.pat=w.pat) # F1 LD F1 Model # ----------------------- # Check that the order of the time and group levels are correct. # Time level: 0 1 2 3 4 # Group level: control thyrox thiour # If the order is not correct, specify the correct order in time.order or # group.order. ## Wald-type statistic ex.f1f1$Wald.test # Statistic df p-value #Treatment 12.52657 2 1.904977e-03 #Week 3619.03739 4 0.000000e+00 #Treatment:Week 70.34311 8 4.199050e-12 ## ANOVA-type statistic ex.f1f1$ANOVA.test # Statistic df p-value #Treatment 5.286582 1.922792 5.654723e-03 #Week 1008.512138 1.990411 0.000000e+00 #Treatment:Week 11.093940 3.516933 3.616929e-08 ## ANOVA-type statistic for the whole-plot factor ex.f1f1$ANOVA.test.mod.Box # Statistic df1 df2 p-value #Treatment 5.286582 1.922792 19.23468 0.01563658 ## The same analysis can be done using the wrapper function "nparLD" ## ex.f1f1np<-nparLD(resp~time*group, data=rat, subject="subject", description=FALSE) # F1 LD F1 Model # ----------------------- # Check that the order of the time and group levels are correct. # Time level: 0 1 2 3 4 # Group level: control thyrox thiour # If the order is not correct, specify the correct order in time.order or # group.order.
Measurements of health status in an ordinal scale from 0 to 4 from a group of patients with a respiratory disorder.
data(respiration)
data(respiration)
Longitudinal data of health status of 111 patients with a respiratory disorder from both the control and treatment groups (57 and 54 patients, respectively) taken at each of their 5 visits in 2 different centers (56 and 55 patients, respectively).
Researchers are often concerned with ordinal responses in clinical trials. Koch et al. (1990) discuss the problem with such ordinal data arising from a clinical trial for patients with a respiratory disorder with multiple whole-plot factors. In this dataset, a total of 111 paties from two centers were randomly assigned to either the control or treatment group, and their responses in an ordinal scale from 0 to 4, indicating their health status, were recorded over their 5 visits.
Brunner, E., Domhof, S., and Langer, F. (2002). Nonparametric Analysis of Longitudinal Data in Factorial Experiments,
Wiley, New York.
Brunner, E. and Langer, F. (1999). Nichtparametrische Analyse longitudinaler Daten,
R. Oldenbourg Verlag, Munchen Wien.
Koch, G.G., Carr, G.J., Amara, I.A., Stokes, M.E., and Uryniak, T.J. (1990).
Categorical Data Analysis. Statistical Methodology in the Pharmaceutical Sciences, D. A. Berry ed., pp.389-473.
Noguchi, K., Gel, Y.R., Brunner, E., and Konietschke, F. (2012). nparLD: An R Software Package for the Nonparametric Analysis of Longitudinal Data in Factorial Experiments. Journal of Statistical Software, 50(12), 1-23.
## Analysis using F1-LD-F2 design ## data(respiration) attach(respiration) ex.f2f1<-f2.ld.f1(y=resp, time=time, group1=center, group2=treatment, subject=patient, time.name="Time", group1.name="Center", group2.name="Treatment", description=FALSE) # F2 LD F1 Model # ----------------------- # Check that the order of the time, group1, and group2 levels are correct. # Time level: 1 2 3 4 5 # Group1 level: 1 2 # Group2 level: A P # If the order is not correct, specify the correct order in time.order, # group1.order, or group2.order. ## Wald-type statistic ex.f2f1$Wald.test # Statistic df p-value #Center 10.2569587 1 0.001361700 #Treatment 9.3451482 1 0.002235766 #Time 17.4568433 4 0.001575205 #Center:Treatment 1.2365618 1 0.266134717 #Center:Time 8.7200395 4 0.068491057 #Treatment:Time 17.5434583 4 0.001515158 #Center:Treatment:Time 0.2898785 4 0.990458142 ## ANOVA-type statistic ex.f2f1$ANOVA.test # Statistic df p-value #Center 10.25695866 1.000000 0.0013616998 #Treatment 9.34514819 1.000000 0.0022357657 #Time 4.43527016 3.320559 0.0028528788 #Center:Treatment 1.23656176 1.000000 0.2661347165 #Center:Time 1.60699585 3.320559 0.1802120504 #Treatment:Time 5.46185031 3.320559 0.0005867392 #Center:Treatment:Time 0.05915234 3.320559 0.9866660535 ## ANOVA-type statistic for the whole-plot factors and ## their interaction ex.f2f1$ANOVA.test.mod.Box # Statistic df1 df2 p-value #Center 10.256959 1 104.9255 0.001803091 #Treatment 9.345148 1 104.9255 0.002836284 #Center:Treatment 1.236562 1 104.9255 0.268676117 ## The same analysis can be done using the wrapper function "nparLD" ## ex.f2f1np<-nparLD(resp~time*center*treatment, data=respiration, subject="patient", description=FALSE) # F2 LD F1 Model # ----------------------- # Check that the order of the time, group1, and group2 levels are correct. # Time level: 1 2 3 4 5 # Group1 level: 1 2 # Group2 level: A P # If the order is not correct, specify the correct order in time.order, # group1.order, or group2.order.
## Analysis using F1-LD-F2 design ## data(respiration) attach(respiration) ex.f2f1<-f2.ld.f1(y=resp, time=time, group1=center, group2=treatment, subject=patient, time.name="Time", group1.name="Center", group2.name="Treatment", description=FALSE) # F2 LD F1 Model # ----------------------- # Check that the order of the time, group1, and group2 levels are correct. # Time level: 1 2 3 4 5 # Group1 level: 1 2 # Group2 level: A P # If the order is not correct, specify the correct order in time.order, # group1.order, or group2.order. ## Wald-type statistic ex.f2f1$Wald.test # Statistic df p-value #Center 10.2569587 1 0.001361700 #Treatment 9.3451482 1 0.002235766 #Time 17.4568433 4 0.001575205 #Center:Treatment 1.2365618 1 0.266134717 #Center:Time 8.7200395 4 0.068491057 #Treatment:Time 17.5434583 4 0.001515158 #Center:Treatment:Time 0.2898785 4 0.990458142 ## ANOVA-type statistic ex.f2f1$ANOVA.test # Statistic df p-value #Center 10.25695866 1.000000 0.0013616998 #Treatment 9.34514819 1.000000 0.0022357657 #Time 4.43527016 3.320559 0.0028528788 #Center:Treatment 1.23656176 1.000000 0.2661347165 #Center:Time 1.60699585 3.320559 0.1802120504 #Treatment:Time 5.46185031 3.320559 0.0005867392 #Center:Treatment:Time 0.05915234 3.320559 0.9866660535 ## ANOVA-type statistic for the whole-plot factors and ## their interaction ex.f2f1$ANOVA.test.mod.Box # Statistic df1 df2 p-value #Center 10.256959 1 104.9255 0.001803091 #Treatment 9.345148 1 104.9255 0.002836284 #Center:Treatment 1.236562 1 104.9255 0.268676117 ## The same analysis can be done using the wrapper function "nparLD" ## ex.f2f1np<-nparLD(resp~time*center*treatment, data=respiration, subject="patient", description=FALSE) # F2 LD F1 Model # ----------------------- # Check that the order of the time, group1, and group2 levels are correct. # Time level: 1 2 3 4 5 # Group1 level: 1 2 # Group2 level: A P # If the order is not correct, specify the correct order in time.order, # group1.order, or group2.order.
Measurements of shoulder pain levels from a group of patients having undergone laparoscopic surgery in abdomen.
data(shoulder)
data(shoulder)
Longitudinal data of 41 patients from both a treatment and a control group with shoulder pain scores taken on 6 occasions (2 times a day for 3 days).
In the shoulder tip pain study described by Lumley (1996), the shoulder pain typically experienced in patients having undergone laparoscopic surgery in the abdomen was observed in a total of 41 patients. A subgroup of 22 randomly selected patients received a treatment in which the air was removed by using a specific suction procedure (treatment Y). The remaining 19 patients served as the control group (treatment N). The pain was subjectively assessed by means of pain-scores (1=low through 5=high). This score was repeatedly measured in the morning and the evening of the first three days after the operation, yielding six repeated measurements for each patient. The patients were stratified according to gender (M=male, F=female) since pain sensitivity may depend on the gender of the patient.
Brunner, E., Domhof, S., and Langer, F. (2002). Nonparametric Analysis of Longitudinal Data in Factorial Experiments,
Wiley, New York.
Brunner, E. and Langer, F. (1999). Nichtparametrische Analyse longitudinaler Daten,
R. Oldenbourg Verlag, Munchen Wien.
Lumley, T. (1996). Generalized estimating equations for ordinal data: A note on working correlation structures.
Biometrics 52, 354-361.
Noguchi, K., Gel, Y.R., Brunner, E., and Konietschke, F. (2012). nparLD: An R Software Package for the Nonparametric Analysis of Longitudinal Data in Factorial Experiments. Journal of Statistical Software, 50(12), 1-23.
## Analysis using F2-LD-F1 design ## data(shoulder) attach(shoulder) ex.f2f1<-f2.ld.f1(y=resp, time=time, group1=group1, group2=group2, subject=subject, time.name="Time", group1.name="Treatment", group2.name="Gender", description=FALSE) # Check that the order of the time, group1, and group2 levels are correct. # Time level: 1 2 3 4 5 6 # Group1 level: Y N # Group2 level: F M # If the order is not correct, specify the correct order in time.order, # group1.order, or group2.order. # # # Warning(s): # The covariance matrix is singular. ## Wald-type statistic ex.f2f1$Wald.test # Statistic df p-value #Treatment 16.40129021 1 5.125033e-05 #Gender 0.04628558 1 8.296575e-01 #Time 16.34274332 5 5.930698e-03 #Treatment:Gender 0.03583558 1 8.498554e-01 #Treatment:Time 27.51450085 5 4.527996e-05 #Gender:Time 12.37903186 5 2.994753e-02 #Treatment:Gender:Time 5.11864769 5 4.015727e-01 ## ANOVA-type statistic ex.f2f1$ANOVA.test # Statistic df p-value #Treatment 16.40129021 1.000000 5.125033e-05 #Gender 0.04628558 1.000000 8.296575e-01 #Time 3.38218704 2.700754 2.120366e-02 #Treatment:Gender 0.03583558 1.000000 8.498554e-01 #Treatment:Time 3.71077200 2.700754 1.398190e-02 #Gender:Time 1.14434841 2.700754 3.272967e-01 #Treatment:Gender:Time 0.43755394 2.700754 7.054255e-01 ## ANOVA-type statistic for the whole-plot factors and ## their interaction ex.f2f1$ANOVA.test.mod.Box # Statistic df1 df2 p-value #Treatment 16.40129021 1 21.86453 0.0005395379 #Gender 0.04628558 1 21.86453 0.8316516274 #Treatment:Gender 0.03583558 1 21.86453 0.8516017168
## Analysis using F2-LD-F1 design ## data(shoulder) attach(shoulder) ex.f2f1<-f2.ld.f1(y=resp, time=time, group1=group1, group2=group2, subject=subject, time.name="Time", group1.name="Treatment", group2.name="Gender", description=FALSE) # Check that the order of the time, group1, and group2 levels are correct. # Time level: 1 2 3 4 5 6 # Group1 level: Y N # Group2 level: F M # If the order is not correct, specify the correct order in time.order, # group1.order, or group2.order. # # # Warning(s): # The covariance matrix is singular. ## Wald-type statistic ex.f2f1$Wald.test # Statistic df p-value #Treatment 16.40129021 1 5.125033e-05 #Gender 0.04628558 1 8.296575e-01 #Time 16.34274332 5 5.930698e-03 #Treatment:Gender 0.03583558 1 8.498554e-01 #Treatment:Time 27.51450085 5 4.527996e-05 #Gender:Time 12.37903186 5 2.994753e-02 #Treatment:Gender:Time 5.11864769 5 4.015727e-01 ## ANOVA-type statistic ex.f2f1$ANOVA.test # Statistic df p-value #Treatment 16.40129021 1.000000 5.125033e-05 #Gender 0.04628558 1.000000 8.296575e-01 #Time 3.38218704 2.700754 2.120366e-02 #Treatment:Gender 0.03583558 1.000000 8.498554e-01 #Treatment:Time 3.71077200 2.700754 1.398190e-02 #Gender:Time 1.14434841 2.700754 3.272967e-01 #Treatment:Gender:Time 0.43755394 2.700754 7.054255e-01 ## ANOVA-type statistic for the whole-plot factors and ## their interaction ex.f2f1$ANOVA.test.mod.Box # Statistic df1 df2 p-value #Treatment 16.40129021 1 21.86453 0.0005395379 #Gender 0.04628558 1 21.86453 0.8316516274 #Treatment:Gender 0.03583558 1 21.86453 0.8516017168
This function prints out a summary of the object returned by the function nparLD
. The summary includes the model and the corresponding formula, the relative treatment effect (RTE), the Wald-type statistic (WTS), and the ANOVA-type statistic (ATS).
## S3 method for class 'nparLD' summary(object, ...)
## S3 method for class 'nparLD' summary(object, ...)
object |
an |
... |
further arguments passed to or from other methods. |
The Fx-LD-Fy design refers to the experimental design with x whole-plot factor and y sub-plot factors. A whole-plot (between-subjects) factor refers to a factor effective for each subject at all times. A sub-plot (within-subjects) factor refers to a factor effective at a single time point for all time curves and all subjects. The LD-Fy design refers to the experimental design with no whole-plot factor. See Brunner et al. (2002) for more examples.
A list with the following numeric components.
RTE |
summary of the relative treatment effect (RTE) in a n-by-3 matrix form, where n is the total number of time1, time2, and group levels, and group-time interactions; the summary includes the mean of the ranks (RankMeans) in the 1st column, number of observations without counting the repeated measurements within the cell (Nobs) in the 2nd column, and the relative treatment effect (RTE) in the 3rd column. |
Wald.test |
the test statistic, the degrees of freedom (df) of the central chi-squared distribution, and the corresponding p-value of the Wald-type test. |
ANOVA.test |
the test statistic, the numerator degrees of freedom (df) of the central F distribution, and the corresponding p-value of the ANOVA-type test; the denominator degrees of freedom is set to infinity. |
covariance |
the covariance matrix. |
Conf.Int |
the (pointwise) 100(1-alpha) percent confidence intervals. See |
... |
Other function-specific outputs. For example, |
Although we provide both Wald-type statistic (WTS, see Wald.test
) and ANOVA-type statistic with the denominator degrees of freedom set to infinity (ATS, see ANOVA.test
), ATS is typically preferred to WTS as it requires less assumptions on the covariance matrix and it has superior small sample performances. Moreover, for the main effects and interactions involving only the whole-plot factors, the modified ANOVA-type statistic with Box (1954) approximation (ANOVA.test.mod.Box
) is preferred to ATS. See Brunner et al. (2002) for more details.
Kimihiro Noguchi, Karthinathan Thangavelu, Frank Konietschke, Yulia Gel, Edgar Brunner
Box, G.E.P. (1954). Some theorems on quadratic forms applied in the study of analysis of variance problems, I. Effect of inequality of variance in the one-way classification. Annals of Mathematical Statistics, 25, 290-302.
Brunner, E., Domhof, S., and Langer, F. (2002). Nonparametric Analysis of Longitudinal Data in Factorial Experiments,
Wiley, New York.
Brunner, E. and Langer, F. (1999). Nichtparametrische Analyse longitudinaler Daten,
R. Oldenbourg Verlag, Munchen Wien.
Noguchi, K., Gel, Y.R., Brunner, E., and Konietschke, F. (2012). nparLD: An R Software Package for the Nonparametric Analysis of Longitudinal Data in Factorial Experiments. Journal of Statistical Software, 50(12), 1-23.
nparLD
, ld.f1
, ld.f2
, f1.ld.f1
, f1.ld.f2
, f2.ld.f1
, ld.ci
, amylase
, edema
, shoulder
, tree
, panic
, panic2
, plasma
, dental
, rat
, respiration
## Example with the "Panic disorder study I" data (LD-F1 design) ## data(panic) ex.f1.np<-nparLD(resp~time, data=panic, subject="subject", description=FALSE, order.warning=FALSE) summary.nparLD(ex.f1.np) #Model: #LD F1 Model #Call: #resp ~ time #Relative Treatment Effect (RTE): # RankMeans Nobs RTE #time0 66.09375 16 0.8199219 #time2 50.50000 16 0.6250000 #time4 41.28125 16 0.5097656 #time6 25.62500 16 0.3140625 #time8 19.00000 16 0.2312500 #Wald-Type Statistc (WTS): # Statistic df p-value #time 126.6946 4 1.9822e-26 #ANOVA-Type Statistc (ATS): # Statistic df p-value #time 36.93664 2.234135 1.975781e-18
## Example with the "Panic disorder study I" data (LD-F1 design) ## data(panic) ex.f1.np<-nparLD(resp~time, data=panic, subject="subject", description=FALSE, order.warning=FALSE) summary.nparLD(ex.f1.np) #Model: #LD F1 Model #Call: #resp ~ time #Relative Treatment Effect (RTE): # RankMeans Nobs RTE #time0 66.09375 16 0.8199219 #time2 50.50000 16 0.6250000 #time4 41.28125 16 0.5097656 #time6 25.62500 16 0.3140625 #time8 19.00000 16 0.2312500 #Wald-Type Statistc (WTS): # Statistic df p-value #time 126.6946 4 1.9822e-26 #ANOVA-Type Statistc (ATS): # Statistic df p-value #time 36.93664 2.234135 1.975781e-18
Measurements of the vitality condition of the treetops on a grading scale from three experimental sites.
data(tree)
data(tree)
Longitudinal data of 72 trees from three areas with the treetop vitality scores taken on 4 occasions.
In this study, the condition of the trees in all three experimental sites was evaluated by means of a crane constructed for the examination of the treetops. Each individual tree was identified (22 trees in the D0 area, 23 in the D2 area, and 27 in the D1 area) and categorized according to the vitality of the tree using a grading scale from 1 (vital) to 10 (dead). This determination of the vitality status was conducted each year from 1993 until 1996.
Brunner, E., Domhof, S., and Langer, F. (2002). Nonparametric Analysis of Longitudinal Data in Factorial Experiments,
Wiley, New York.
Brunner, E. and Langer, F. (1999). Nichtparametrische Analyse longitudinaler Daten,
R. Oldenbourg Verlag, Munchen Wien.
Noguchi, K., Gel, Y.R., Brunner, E., and Konietschke, F. (2012). nparLD: An R Software Package for the Nonparametric Analysis of Longitudinal Data in Factorial Experiments. Journal of Statistical Software, 50(12), 1-23.
## Analysis using F1-LD-F1 design ## data(tree) attach(tree) w.t<-c(1:4) w.g<-c(1:3) w.pat <- rbind(c(1:4), c(1:4), c(1:4)) ex.f1f1<-f1.ld.f1(y=resp, time=time, group=group, subject=subject, w.pat=w.pat, w.t=w.t, w.g=w.g, time.name="Year", group.name="Area", description=FALSE) # F1 LD F1 Model # ----------------------- # Check that the order of the time and group levels are correct. # Time level: 1 2 3 4 # Group level: D0 D2 D1 # If the order is not correct, specify the correct order in time.order or # group.order. ## Wald-type statistic ex.f1f1$Wald.test #Area 4.510037 2 1.048716e-01 #Year 58.061097 3 1.525356e-12 #Area:Year 14.819966 6 2.170415e-02 ## ANOVA-type statistic ex.f1f1$ANOVA.test # Statistic df p-value #Area 2.352854 1.968147 9.601181e-02 #Year 21.389142 2.729147 8.210954e-13 #Area:Year 3.113632 5.346834 6.768732e-03 ## ANOVA-type statistic for the whole-plot factor ex.f1f1$ANOVA.test.mod.Box # Statistic df1 df2 p-value #Area 2.352854 1.968147 64.3979 0.1040525
## Analysis using F1-LD-F1 design ## data(tree) attach(tree) w.t<-c(1:4) w.g<-c(1:3) w.pat <- rbind(c(1:4), c(1:4), c(1:4)) ex.f1f1<-f1.ld.f1(y=resp, time=time, group=group, subject=subject, w.pat=w.pat, w.t=w.t, w.g=w.g, time.name="Year", group.name="Area", description=FALSE) # F1 LD F1 Model # ----------------------- # Check that the order of the time and group levels are correct. # Time level: 1 2 3 4 # Group level: D0 D2 D1 # If the order is not correct, specify the correct order in time.order or # group.order. ## Wald-type statistic ex.f1f1$Wald.test #Area 4.510037 2 1.048716e-01 #Year 58.061097 3 1.525356e-12 #Area:Year 14.819966 6 2.170415e-02 ## ANOVA-type statistic ex.f1f1$ANOVA.test # Statistic df p-value #Area 2.352854 1.968147 9.601181e-02 #Year 21.389142 2.729147 8.210954e-13 #Area:Year 3.113632 5.346834 6.768732e-03 ## ANOVA-type statistic for the whole-plot factor ex.f1f1$ANOVA.test.mod.Box # Statistic df1 df2 p-value #Area 2.352854 1.968147 64.3979 0.1040525