pgu.regressor: pgu.regressor

Description Format Details Active bindings Methods Author(s)

Description

A class that performs pairwise robust regression on the pguIMP data set.

Format

R6::R6Class object.

Details

A class that performs pairwise robust regression on the pguIMP data set. This object is used by the shiny based gui and is not for use in individual R-scripts!

Active bindings

featureNames

Returns the instance variable featureNames. (character)

setFeatureNames

Sets the instance variable featureNames. It further initializes the instance variables: intercept, pIntercept, slope, pSlope. (character)

intercept

Returns the instance variable intercept. (matrix)

pIntercept

Returns instance variable pIntercept. (matrix)

slope

Returns the instance variable slope. (matrix)

pSlope

Returns the instance variable pSlope. (matrix)

model

Returns the instance variable model. (robust::lmRob)

Methods

Public methods


Method new()

Creates and returns a new pgu.regressor object.

Usage
pgu.regressor$new(data = "tbl_df")
Arguments
data

The data to be modeled. (tibble::tibble)

Returns

A new pgu.regressor object. (pguIMP::pgu.regressor)


Method finalize()

Clears the heap and indicates if instance of pgu.regressor is removed from heap.

Usage
pgu.regressor$finalize()

Method print()

Prints instance variables of a pgu.regressor object.

Usage
pgu.regressor$print()
Returns

string


Method resetRegressor()

Performes pair-wise robust linear regression on the attributes of the data tibble. Progresse is indicated by the progress object passed to the function.

Usage
pgu.regressor$resetRegressor(data = "tbl_df", progress = "Progress")
Arguments
data

Dataframe with at least two numeric attributes. (tibble::tibble)

progress

Keeps track of the analysis progress. (shiny::Progress)


Method resetDiagonal()

Sets the diagonal of a square matrix to NA.

Usage
pgu.regressor$resetDiagonal(data = "matrix")
Arguments
data

The matrix whose diagonal is to be reset. (matrix)

Returns

A matrix with its diagonal reset to NA. (matrix)


Method resetMatrix()

Creates a square matrix which dimension corresponds to the length of the instance variable featureNames. The matrix entries are set to a distict value. The diagonal is set to NA.

Usage
pgu.regressor$resetMatrix(value = "numeric")
Arguments
value

The value the matrix entries are set to. (numeric)

Returns

A square matrix. (matrix)


Method featureIdx()

Determines the numerical index of the column of an attribute based on the attribute name.

Usage
pgu.regressor$featureIdx(feature = "character")
Arguments
feature

The attribute's name. (character)

Returns

The attributes column index. (numeric)


Method featureIsValid()

Checks if the feature is known to the class.

Usage
pgu.regressor$featureIsValid(feature = "character")
Arguments
feature

An attribute's name that is to be checked. (character)

Returns

The test result. (logical)


Method featurePairIsValid()

Checks a if a pair of attributes different and known to the class.

Usage
pgu.regressor$featurePairIsValid(
  abscissa = "character",
  ordinate = "character"
)
Arguments
abscissa

An attribute's name that is to be checked. (character)

ordinate

An attribute's name that is to be checked. (character)

Returns

The test result. (logical)


Method createModel()

Creates a robust model of linear regression between two attributes of a dataframe. The model is stored as instance variable.

Usage
pgu.regressor$createModel(
  data = "tbl_df",
  abscissa = "character",
  ordinate = "character"
)
Arguments
data

The data to be modeled. (tibble::tibble)

abscissa

An attribute's name that equals a column name in the data. (character)

ordinate

An attribute's name that equals a column name in the data. (character)


Method createRegressionMatrix()

Performs the actual robust linear regression routine. Iteratively runs through the attributes known to the class and creates a robust linear regression model for each valid attribute pair. The model results are stored in the instance variables: intercept, pIntercept, slope, pSlope. Here, pX represents the p-value of the respective parameter X. Displays the progress if shiny is loaded.

Usage
pgu.regressor$createRegressionMatrix(data = "tbl_df", progress = "Progress")
Arguments
data

The data to be modeled. (tibble::tibble)

progress

If shiny is loaded, the analysis' progress is stored within this instance of the shiny Progress class. (shiny::Progress)


Method printModel()

Transforms the results of the modeling procedure for a valid pair of attributes to a dataframe and returns it.

Usage
pgu.regressor$printModel(abscissa = "character", ordinate = "character")
Arguments
abscissa

The name of the attribute which is assigned to the abscissa. (character)

ordinate

The name of the attribute which is assigned to the ordinate. (character)

Returns

The analyis result as a dataframe. (tibble::tibble)


Method printInterceptTbl()

Transfroms instance variable intercept to a dataframe and returns it.

Usage
pgu.regressor$printInterceptTbl()
Returns

Dataframe of instance variable intercept. (tibble::tibble)


Method printPInterceptTbl()

Transfroms instance variable pIntercept to a dataframe and returns it.

Usage
pgu.regressor$printPInterceptTbl()
Returns

Dataframe of instance variable pIntercept. (tibble::tibble)


Method printSlopeTbl()

Transfroms instance variable slope to a dataframe and returns it.

Usage
pgu.regressor$printSlopeTbl()
Returns

Dataframe of instance variable slope. (tibble::tibble)


Method printPSlopeTbl()

Transfroms instance variable pSlope to a dataframe and returns it.

Usage
pgu.regressor$printPSlopeTbl()
Returns

Dataframe of instance variable pSlope. (tibble::tibble)


Method plotRegression()

Creates a scatter plot of the model stored within the instance variable of the class.

Usage
pgu.regressor$plotRegression()
Returns

A scatter plot. (ggplot2::ggplot)


Method plotResidualDist()

Creates a histogram of the residual distribution of the model stored within the instance variable of the class.

Usage
pgu.regressor$plotResidualDist()
Returns

A histogram plot. (ggplot2::ggplot)


Method plotResidualBox()

Creates a box plot of the residual distribution of the model stored within the instance variable of the class.

Usage
pgu.regressor$plotResidualBox()
Returns

A box plot. (ggplot2::ggplot)


Method plotModel()

Creates a model of robust linear regression. Executes all graphical exploration functions of the class and creates a composite graph based on their results.

Usage
pgu.regressor$plotModel(
  data = "tbl_df",
  abscissa = "character",
  ordinate = "character"
)
Arguments
data

The data to be modeled. (tibble::tibble)

abscissa

The name of the attribute which is assigned to the abscissa. (character)

ordinate

The name of the attribute which is assigned to the ordinate. (character)

Returns

A composite graph. (gridExtra::grid.arrange)


Method clone()

The objects of this class are cloneable with this method.

Usage
pgu.regressor$clone(deep = FALSE)
Arguments
deep

Whether to make a deep clone.

Author(s)

Sebastian Malkusch, malkusch@med.uni-frankfurt.de


pguIMP documentation built on Sept. 30, 2021, 5:08 p.m.