Learn R Programming

eiwild (version 0.6.7)

betaCheck: betaCheck function

Description

Given starting values for the beta values on the first level of the ecological inference model, betaCheck checks if parameters are correctly specified

Usage

betaCheck(arr, r, c, prec)

Arguments

arr
array with beta values. 1st dimension: rows, 2nd dimension columns, 3rd dimension precincts
r
number of rows in the RxC-table
c
number of cols in the RxC-table
prec
number of precincts

Value

betaarry if everything is okay. Error-message if something fails.

Examples

Run this code
## Not run: 
# # right beta array
# beta1 <- rep(c(0,0.25,0.75), each=3)
# beta2 <- rep(beta1, 3)
# betaRight <- array(beta2, dim=c(3,3,3))
# betaCheck(betaRight, 3,3,3)
# 
# # wrong beta array
# betaWrong <- array(1:27, dim=c(3,3,3))
# betaCheck(betaWrong)
# ## End(Not run)

Run the code above in your browser using DataLab