Skip to content

rgranger617/BLRCR

Repository files navigation

BLRCR

A package for using the BLRCR model.

Installation

R Installation

Begin with installing R and RStudio.

Install Package “BLRCR”

You can install this beta version of BLRCR from GitHub with:

# install.packages("devtools")
devtools::install_github("rgranger617/BLRCR")

Usage

Check out the BLRCRsolvermissing() function:

library(BLRCR)

#Create the Data
myN = 2000

mybeta = matrix(c(-2,-1,1,
                  -2,1,-1,
                  -2,-1,1,
                  -2,1,-1),nrow=4,byrow=TRUE)
                  
mynormprobs=c(0.3,0.4,0.3)

mynormmeans=matrix(c(2,2,
                     0,0,
                     -2,-2),ncol=2,byrow=TRUE)
                     
mynormsigma=matrix(c(.5,.45,.45,.5,
                      1,0,0,1,
                      .5,-.35,-.35,.5),nrow=3,byrow=TRUE)

myCRdata = multdatasimulator(myN,mybeta,mynormprobs,mynormmeans,mynormsigma,
                           missing=TRUE)
                           
#Run the Algorithm
myformula = cbind(y1,y2,y3,y4)~x1+x2

CRresults=BLRCRsolvermissing(myformula,df=myCRdata,Homega=1,
                             Bprior=1,LBprior=1,
                             covsupport="unique",
                             samples = 1000,burnin=10,thinning = 10)

quantile(CRresults$N,c(.025,.5,.975))

About

Bayesian Logistic Regression Capture-Recapture

Resources

License

Unknown, MIT licenses found

Licenses found

Unknown
LICENSE
MIT
LICENSE.md

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published