generalizedMatrix {modgo}R Documentation

Generalized Lambda and Poisson preparation

Description

Prepare the four moments matrix for GLD and GPD

Usage

generalizedMatrix(
  data,
  variables = colnames(data),
  bin_variables = NULL,
  generalized_mode_model = NULL,
  multi_sugg_prop = NULL
)

Arguments

data

a data frame with original variables.

variables

a vector of which variables you want to transform. Default:colnames(data)

bin_variables

a character vector listing the binary variables.

generalized_mode_model

A matrix that contains two columns named "Variables" and "Model". This matrix can be used only if a generalized_mode_model argument is provided. It specifies what model should be used for each Variable. Model values should be "RMFMKL", "RPRS", "STAR" or a combination of them, e.g. "RMFMKL-RPRS" or "STAR-STAR", in case the use wants a bimodal simulation. The user can select Generalized Poisson model for poisson variables, but this model cannot be included in bimodal simulation

multi_sugg_prop

A named vector that provides a proportion of value=1 for specific binary variables(=name of the vector) that will be the close to the proportion of this value in the simulated data sets

Value

A numeric matrix with the four moments for each distribution and a number that corresponds to a GLD model

Author(s)

Francisco M. Ojeda, George Koliopanos

Examples

 
data("Cleveland",package="modgo")
Variables <- c("Age","STDepression")
Model <- c("rprs", "star-rmfmkl")
model_matrix <- cbind(Variables,
                     Model)
test_modgo <- generalizedMatrix(data = Cleveland,
     generalized_mode_model = model_matrix,
     bin_variables = c("CAD","HighFastBloodSugar","Sex","ExInducedAngina"))


[Package modgo version 1.0.1 Index]