distreg.sas {bayesdistreg} R Documentation

## Semi-asymptotic bayesian distribution

### Description

distreg.sas takes input object from dr_asympar() for semi asymptotic bayesian distribution. This involves taking random draws from the normal approximation of the posterior at each threshold value.

### Usage

distreg.sas(ind, drabj, data, vcovfn = "vcov", iter = 100)


### Arguments

 ind index of object in list drabj (i.e. a threshold value) from which to take draws drabj object from dr_asympar() data dataframe, first column is the outcome vcovfn a string denoting the function to extract the variance-covariance. Defaults at "vcov". Other variance-covariance estimators in the sandwich package are usable. iter number of draws to simulate

### Value

fitob vector of random draws from density of F(yo) using semi-asymptotic BDR

### Examples

y = faithful$waiting x = scale(cbind(faithful$eruptions,faithful\$eruptions^2))
qtaus = quantile(y,c(0.05,0.25,0.5,0.75,0.95))
drabj<- dr_asympar(y=y,x=x,thresh = qtaus); data = data.frame(y,x)
drsas1 = lapply(1:5,distreg.sas,drabj=drabj,data=data,iter=100)
drsas2 = lapply(1:5,distreg.sas,drabj=drabj,data=data,vcovfn="vcovHC",iter=100)
par(mfrow=c(3,2));invisible(lapply(1:5,function(i)plot(density(drsas1[[i]],.1))));par(mfrow=c(1,1))
par(mfrow=c(3,2));invisible(lapply(1:5,function(i)plot(density(drsas2[[i]],.1))));par(mfrow=c(1,1))



[Package bayesdistreg version 0.1.0 Index]