# Variance functions See Vittinghof 2011
normal_var <- function(var_y) {
if (var_y <= 0)
stop("var_y must be positive")
var <- var_y
return(var)
}
binomial_var <- function(prob) {
if (prob <= 0 | prob >= 1)
stop("prob must be between 0 and 1")
var <- 1/(prob * (1 - prob))
return(var)
}
cox_reg_var <- function(prob_uncens) {
if (prob_uncens <= 0)
stop("psi must be positive")
if (prob_uncens >= 1)
stop("psi must be less than 1")
var <- 1/prob_uncens
return(var)
}
pois_var <- function(disp) {
if (disp < 1)
stop("ratio of mean to dispersion parameter must be greater or equal to 1")
var <- disp
return(var)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.