Learn R Programming

cg (version 1.0-3)

fit: Fit models to data

Description

Fit data objects prepared by the cg package.

Usage

fit(data, type, ...)

Arguments

data
A data object prepared with a prepare call. This will involve a data frame and additional settings.
type
Type of model to fit, represented by a character string.
...
Additional arguments, depending on the specific method written for the object.

Value

A method-specific fit object is returned. See the specific methods for discussion of return values.

See Also

fit.cgOneFactorData

Examples

Run this code
## Unpaired Samples, One Factor
data(canine)
canine.data <- prepareCGOneFactorData(canine, format="groupcolumns",
                                      analysisname="Canine",
                                      endptname="Prostate Volume",
                                      endptunits=expression(plain(cm)^3),
                                      digits=1, logscale=TRUE, refgrp="CC")
canine.fit <- fit(canine.data, type="rr")


data(gmcsfcens)
gmcsfcens.data <- prepareCGOneFactorData(gmcsfcens, format="groupcolumns",
                                         analysisname="cytokine",
                                         endptname="GM-CSF (pg/ml)",
                                         logscale=TRUE)

gmcsfcens.fit <- fit(gmcsfcens.data, type="aft")

## Paired Difference

data(anorexiaFT)
anorexiaFT.data <- prepareCGPairedDifferenceData(anorexiaFT, format="groupcolumns",
                                                 analysisname="Anorexia FT",
                                                 endptname="Weight",
                                                 endptunits="lbs",
                                                 expunitname="Patient",
                                                 digits=1, logscale=TRUE)
anorexiaFT.fit <- fit(data=anorexiaFT.data, type="rr")	

		  

Run the code above in your browser using DataLab