featureAdjustment: Adjust each listed variable to the provided set of covariates

View source: R/featureAdjustment.R

featureAdjustmentR Documentation

Adjust each listed variable to the provided set of covariates

Description

This function fits the candidate variables to the provided model formula,for each strata, on a control population. If the variance of the residual (the fitted observation minus the real observation) is reduced significantly, then, such residual is used in the resulting data frame. Otherwise, the control mean is subtracted to the observation.

Usage

	featureAdjustment(variableList,
	                  baseFormula,
	                  strata = NA,
	                  data,
	                  referenceframe,
	                  type = c("LM", "GLS", "RLM","NZLM","SPLINE","MARS","LOESS"),
	                  pvalue = 0.05,
	                  correlationGroup = "ID",
	                  ...
	                  )

Arguments

variableList

A data frame with two columns. The first one must have the names of the candidate variables and the other one the description of such variables

baseFormula

A string of the type "var1 +...+ varn" that defines the model formula to which variables will be fitted

strata

The name of the column in data that stores the variable that will be used to stratify the fitting

data

A data frame where all variables are stored in different columns

referenceframe

A data frame similar to data, but with only the control population

type

Fit type: linear fitting ("LM"), generalized least squares fitting ("GLS") or Robust ("RLM")

pvalue

The maximum p-value, associated to the F-test, for the model to be allowed to reduce variability

correlationGroup

The name of the column in data that stores the variable to be used to group the data (only needed if type defined as "GLS")

...

parameters for smooth.spline,loess or mda::mars)

Value

A data frame, where each input observation has been adjusted from data at each strata

Note

This function prints the residuals and the F-statistic for all candidate variables

Author(s)

Jose G. Tamez-Pena and Antonio Martinez-Torteya


FRESA.CAD documentation built on Nov. 25, 2023, 1:07 a.m.