simdata_bes {bbreg}R Documentation

simdata_bes

Description

Function to generate synthetic data from the bessel regression. Requires the R package "statmod" generate random numbers from the Inverse Gaussian distribution (Giner and Smyth, 2016).

Usage

simdata_bes(kap, lam, x, v, repetitions = 1, link.mean, link.precision)

Arguments

kap

coefficients in kappa related to the mean parameter.

lam

coefficients in lambda related to the precision parameter.

x

matrix containing the covariates for the mean submodel. Each column is a different covariate.

v

matrix containing the covariates for the precision submodel. Each column is a different covariate.

repetitions

the number of random draws to be made.

link.mean

a string containing the link function for the mean. The possible link functions for the mean are "logit","probit", "cauchit", "cloglog".

link.precision

a string containing the link function the precision parameter. The possible link functions for the precision parameter are "identity", "log", "sqrt", "inverse".

Value

a list of response vectors z (with 0 < z_i < 1).

References

DOI:10.32614/RJ-2016-024 (Giner and Smyth; 2016)

See Also

dbessel, dbbtest, simdata_bet

Examples

n = 100; x = cbind(rbinom(n, 1, 0.5), runif(n, -1, 1)); v = runif(n, -1, 1);
z = simdata_bes(kap = c(1, -1, 0.5), lam = c(0.5, -0.5), x, v,
repetitions = 1, link.mean = "logit", link.precision = "log")
z = unlist(z)
hist(z, xlim = c(0, 1), prob = TRUE)

[Package bbreg version 2.0.1 Index]