estimate_final_correlation {simdata}R Documentation

Estimate correlation matrix via simulation

Description

Used to obtain an estimate of the correlation matrix after transforming the initial data.

Usage

estimate_final_correlation(
  obj,
  n_obs = 1e+05,
  cor_type = "pearson",
  seed = NULL,
  ...
)

Arguments

obj

S3 class object of type simdesign (or inheriting from it).

n_obs

Number of observations to simulate.

cor_type

Can be either a character (pearson, spearman, kendall) which is passed to stats::cor or a function, which is directly used to compute the correlation matrix on the simulated data. Such a function is expected to take a single input matrix (and possibly other arguments which can be set via ...) and output a single matrix.

seed

Random number seed. NULL does not change the current seed.

...

Further arguments are passed to the function that computes the correlation matrix (either stats::cor or the user provided function).

Details

This function is useful to estimate the final correlation of the data after transformation of the initial data. To provide a robust estimate it is advised to use a very large number of observations to compute the correlation matrix.

Value

A numeric matrix given by the pairwise correlation coefficients for each pair of variables defined by obj and computed according to cor_type.

See Also

simulate_data, simdesign


[Package simdata version 0.4.0 Index]