confidenceInt: Compute Confidence Intervals for Predicted Trajectories

View source: R/CommonFunction.R

confidenceIntR Documentation

Compute Confidence Intervals for Predicted Trajectories

Description

Calculates predicted values and confidence intervals for the mean trajectory of each group at specified time points.

Usage

confidenceInt(Obj, newtime, alpha = 0.05)

Arguments

Obj

An object containing model parameters, including:

  • degre: Vector of polynomial degrees for each group.

  • varcov: Variance-covariance matrix of the model coefficients.

  • groups: Number of groups in the model.

  • Model: Character string specifying the model type (e.g., "CNORM", "LOGIT").

  • beta: Vector of model coefficients.

newtime

Numeric vector of time points at which to compute predictions and confidence intervals.

alpha

The significance level for the confidence intervals. Default is 0.05, which corresponds to 95% confidence intervals.

Value

A list of class "Trajectory.predict" containing:

  • newtime: The input time points.

  • Ypred: Matrix of predicted values for each group at each time point.

  • SEYpred: Matrix of standard errors for the predicted values.

  • IC.inf: Matrix of the lower bounds of the confidence intervals.

  • IC.sup: Matrix of the upper bounds of the confidence intervals.

  • groups: Number of groups from the input object.

Examples


data <- read.csv(system.file("extdata", "CNORM2gr.csv", package = "trajeR"))
sol <- trajeR(Y = data[, 2:6], A = data[, 7:11], degre = c(2, 2), Model = "CNORM", Method = "L")
newtime <- seq(0, 1, by = 0.1)
result <- confidenceInt(sol, newtime, alpha = 0.05)
print(result)



trajeR documentation built on Aug. 4, 2026, 1:09 a.m.