Learn R Programming

MetaLonDA (version 1.1.8)

curveFitting: Fit longitudinal data

Description

Fits longitudinal samples from the same group using negative binomial smoothing splines or LOWESS

Usage

curveFitting(df, method = "nbinomial", points)

Arguments

df

dataframe has the Count, Group, ID, Time

method

fitting method (nbinomial, lowess)

points

points at which the prediction should happen

Value

returns the fitted model

References

Ahmed Metwally (ametwall@stanford.edu)

Examples

Run this code
# NOT RUN {
data(metalonda_test_data)
n.sample = 5 
n.timepoints = 10 
n.group = 2 
Group = factor(c(rep(0, n.sample*n.timepoints), rep(1, n.sample*n.timepoints)))
Time = rep(rep(1:n.timepoints, times = n.sample), 2)
ID = factor(rep(1:(2*n.sample), each = n.timepoints))
points = seq(1, 10, length.out = 10)
aggretage.df = data.frame(Count = metalonda_test_data[1,], Time = Time, Group = Group, ID = ID)
cf = curveFitting(df = aggretage.df, method= "nbinomial", points)
# }

Run the code above in your browser using DataLab