curveFitting {OmicsLonDA} | R Documentation

## Fit longitudinal data

### Description

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

### Usage

    curveFitting(formula = Count ~ Time, df = "NULL",
      fit.method = "ssgaussian", points = NULL)

### Arguments

`formula` | formula to be passed to the regression model
`df` | dataframe has the Count, Group, Subject, Time
`fit.method` | fitting method (ssgaussian)
`points` | points at which the prediction should happen

### Value

a list that contains fitted smoothing spline for each group along with 95

### References

Ahmed Metwally (ametwall@stanford.edu)

### Examples

    library(SummarizedExperiment)
    data("omicslonda_data_example")
    omicslonda_se_object_adjusted = adjustBaseline(
                     se_object = omicslonda_data_example$omicslonda_se_object)
    se_object = omicslonda_se_object_adjusted[1,]
    dt = data.frame(colData(se_object))
    dt$Count = as.vector(assay(se_object))
    Group = as.character(dt$Group)
    group.levels = sort(unique(Group))
    gr.1 = as.character(group.levels[1])
    gr.2 = as.character(group.levels[2])
    df = dt
    levels(df$Group) = c(levels(df$Group), "0", "1")
    df$Group[which(df$Group == gr.1)] = 0
    df$Group[which(df$Group == gr.2)] = 1
    group.0 = df[df$Group == 0, ]
    group.1 = df[df$Group == 1, ]
    points = seq(1, 500)
    model = curveFitting(formula = Count ~ Time, df = df, fit.method = "ssgaussian", points = points)

[Package OmicsLonDA version 1.8.0 Index]