Learn R Programming

densityratio (version 0.2.1)

summary.lhss: Extract summary from lhss object, including two-sample significance test for homogeneity of the numerator and denominator samples

Description

Extract summary from lhss object, including two-sample significance test for homogeneity of the numerator and denominator samples

Usage

# S3 method for lhss
summary(
  object,
  test = FALSE,
  n_perm = 100,
  parallel = FALSE,
  cluster = NULL,
  ...
)

Value

Summary of the fitted density ratio model

Arguments

object

Object of class lhss

test

logical indicating whether to statistically test for homogeneity of the numerator and denominator samples.

n_perm

Scalar indicating number of permutation samples

parallel

logical indicating to run the permutation test in parallel

cluster

NULL or a cluster object created by makeCluster. If NULL and parallel = TRUE, it uses the number of available cores minus 1.

...

further arguments passed to or from other methods.

Examples

Run this code
set.seed(123)
# Fit model (minimal example to limit computation time)
dr <- lhss(numerator_small, denominator_small,
           nsigma = 5, nlambda = 3, ncenters = 50, maxit = 100)
# Inspect model object
dr
# Obtain summary of model object
summary(dr)
# Plot model object
plot(dr)
# Plot density ratio for each variable individually
plot_univariate(dr)
# Plot density ratio for each pair of variables
plot_bivariate(dr)
# Predict density ratio and inspect first 6 predictions
head(predict(dr))

Run the code above in your browser using DataLab