CrossGEESP {CrossCarry}R Documentation

Run a semi-parametric GEE model for data from a crossover experiment with repeated measures

Description

Provides a GEE model for the data of a crossover design with S sequences of T periods. There must be at least two observations of each experimental unit in each period. The effect of time within period and the possible carryover effects are modeled by means of splines.

Usage

CrossGEESP(
  response,
  period,
  treatment,
  id,
  time,
  carry,
  covar = NULL,
  data,
  family = gaussian,
  correlation = "independence",
  formula = NULL,
  tol = 1e-04,
  niter = 100,
  nodes = NULL
)

Arguments

response

A character string specifying the name of the response variable of the crossover experimental design

period

A character string specifying the name of vector with the observation period of the responses of the crossover experimental design

treatment

A character string specifying the name of vector with the treatment applied at each observation of the crossover experimental design

id

A character string specifying the name of vector which identifies the experimental units. The length of ‘id’ should be the same as the number of observations. Data are assumed to be sorted so that observations on each cluster appear as contiguous rows in data. If data is not sorted this way, the function will not identify the clusters correctly. If data is not sorted this way, a warning will be issued.

time

A character string specifying the name of the vector with the measurement time within each period

carry

A vector of character string specifying the name set of dummy variables that indicates the treatment applied in the previous period of each experimental unit. They must be 0 in period 1

covar

A vector of character string specifying the name of possible covariates of the crossover experimental design

data

A data frame with all the variables of the crossover experimental design

family

See corresponding documentation to glm

correlation

character string specifying the correlation within periods structure. The following are permitted: "independence", "exchangeable", "ar1" and "unstructured"

formula

A formula related the response variable with the explanatory variables. If it is NULL, formula response~period+treatment+carry+time+covar will be evaluated.

tol

the tolerance used in the fitting algorithm.

niter

the maximum number of iterations.

nodes

Number of nodes in the estimation of the splines. By default, the base 2 logarithm of the number of observations per period is used.

Value

QIC The QIC of the model: The model are fitted by geeglm

model The model fitted by geeglm.

graphs The graphs estimated by splines. In position 1 the graph of the effect of time appears and from then on, it appears one for each carryover effect declared in the carry option. The graphs are built with ggplot2, therefore they allow manipulation of axes and other graphic parameters of that library.

Source

https://doi.org/10.1177/09622802231158736

References

Cruz Gutierrez NA, Melo OO, Martinez CA. Semiparametric generalized estimating equations for repeated measurements in cross-over designs. Statistical Methods in Medical Research, 2023;32(5):1033-1050.

Examples

data(Arterial)

carrydata <- createCarry(data=Arterial, treatment = "Treatment",
                         period = "Period",id="Subject", carrySimple = FALSE)
data <- carrydata$data
carry <- carrydata$carryover
model1 <- CrossGEESP(response = "Pressure", treatment = "Treatment",
                    period = "Period", id="Subject", time="Time",
                    carry=carrydata$carryover,data=data,
                    correlation = "exchangeable")


model2 <- CrossGEESP(response = "Pressure", treatment = "Treatment",
                     period = "Period", id="Subject", time="Time",
                     carry=carrydata$carryover,data=data, correlation = "ar1")


model1$QIC
model2$QIC
summary(model1$model)
summary(model2$model)
model1$graph[[1]]
model1$graph[[2]]
plot <- model1$graph[[1]] + ggplot2::xlab("Time in minutes")+
ggplot2::ylab("Change in systolic blood pressure")
plot

[Package CrossCarry version 0.2.0 Index]