simdata_bet: simdata_bet

Description Usage Arguments Value See Also Examples

View source: R/4_em_beta.R

Description

Function to generate synthetic data from the beta regression.

Usage

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

Arguments

kap

coefficients kappa related to the mean parameter.

lam

coefficients 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".

Value

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

See Also

simdata_bes, dbessel, dbbtest

Examples

1
2
3
4
5
6
7
8
9
n <- 100
x <- cbind(rbinom(n, 1, 0.5), runif(n, -1, 1))
v <- runif(n, -1, 1)
z <- simdata_bet(
  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)

vpnsctl/bbreg documentation built on March 14, 2021, 12:11 a.m.