unscoreR: Run the CCG 'unscore' Program to Normal Score Transform...

Description Usage Arguments Value Examples

Description

unscoreR transforms selected variables to a normal distribution using the CCG Fortran program declus. Currently the options to use a category or to use a reference distribution are not supported. Trimming limits are fixed to -1.0e21 and +1.0e21.

Usage

1
2
unscoreR(data, vars, weight = NULL, cat = NULL, quantiles = 0,
  debug = FALSE)

Arguments

data

Data frame with value and optional weight and category columns.

vars

Character vector, column names in data for transformation.

weight

Character scalar, name of weight field, default NULL.

cat

Character scalar, name of category field, default NULL.

quantiles

Integer scalar, number of quantiles output to transformation tables, default 0, which means all.

debug

Scalar boolean. If TRUE don't delete temporary system files. Default is FALSE.

Value

A list of two data frames: data contains original input data plus columns of normal score transformed data for each specified column and trans contains the transformation tables for each transformed variable.

Examples

1
2
3
4
samples_ns <- unscoreR(samples_2d, c("thk", "accum"))
par(mfrow=c(1,2))
hist(samples_ns$data$accum, breaks=30, main="raw", xlab="accum")
hist(samples_ns$data$NS_accum, main="normal", xlab="nscore accum")

truemoid/rgslib documentation built on May 30, 2019, 2:14 p.m.