composition: Get table of estimated weights of transformation

Description Usage Arguments Value Examples

View source: R/composition-function.R

Description

This function get table of estimated weights to transform the input to output dimensions by rsdr() function.

Usage

1
composition(rsdr_object, dimensions = NULL)

Arguments

rsdr_object

RSDR object, a list of results and parameters. This is an output from rsdr() function.

dimensions

Dimension index, a vector of integers for the column indices of the table, indicating the output dimensions transformed by rsdr(). The maximum integer is the minimum number of output dimensions among many dimensional reduction models from differen resampled subsets.

Value

RSDR object, a list of results and parameters. Use plot() to visualize weights that are used to transformed all input dimension to each output dimension.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
## Create input example
library(medhist)
data(medhistdata)
ps_remover=extract_nps_mh(medhistdata)

mh_bin_nps=
  medhistdata[ps_remover_train$key,] %>%
  `exprs<-`(
    exprs(.) %>%
      t() %>%
      as.data.frame() %>%
      rownames_to_column(var='id') %>%
      column_to_rownames(var='id') %>%
      t()
  ) %>%
  trans_binary(verbose=F)
 
input=
  mh_bin_nps %>%
  exprs() %>%
  t() %>%
  as.data.frame()
 
## Fit dimensional reduction models with resampling
rsdr_bin_nps=rsdr(input,'CV',10,'PCA')

## Get table of estimated weights of transformation
composition(rsdr_bin_nps)

herdiantrisufriyana/rsdr documentation built on Feb. 15, 2021, 7:55 p.m.