Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LR Confidence interval for unobs_tr despite vcov matrix is PD #8

Open
yushuf opened this issue Dec 21, 2017 · 5 comments
Open

LR Confidence interval for unobs_tr despite vcov matrix is PD #8

yushuf opened this issue Dec 21, 2017 · 5 comments

Comments

@yushuf
Copy link

yushuf commented Dec 21, 2017

data.zip

library(transtat)
pdata <- read.csv("pdata.csv")
xdata <- read.csv("xdata.csv")
coef <- read.csv("coef.csv", header = TRUE)

pairwise data to be combined with external data

pdat <- pdata
pdat$interval <- pdat$exit - pdat$entry
pdat$external <- 0
pdat$trace <- 1
pdat$start <- 0
pdat$stop <- pdat$interval

external data

xdat <- xdata
names(xdat)[names(xdat) == "x"] <- "susx"
xdat$external <- 1
xdat$infectious <- NA
xdat$infx <- 0
xdat$interval <- xdat$exit # entry is at time 0
xdat$start <- xdat$entry
xdat$stop <- xdat$exit
dat <- rbind(pdat, xdat)

#Transreg works
unobs_tr <- transreg(
Surv(start, stop, infset) ~ infx + susx + ext(external),
sus = "susceptible", data = dat, subset = (trace == 1),
dist = "weibull", xdist = "exponential"
)
#Variance-covariance matrix is PD
eigen(vcov(unobs_tr))$values >.00

#confint keep working for long time, I have waited overnight.
ci_unobs_tr_lr <-confint(unobs_tr, type = 'lr')

#This errors are not informative
confint(unobs_tr, "log(shape)", type = 'lr')
Error in if (!is.numeric(lower) || !is.numeric(upper) || lower >= upper) stop("lower < upper is not fulfilled") :
missing value where TRUE/FALSE needed

confint(unobs_tr, "(Intercept)", type = 'lr')
Error in if (!is.numeric(lower) || !is.numeric(upper) || lower >= upper) stop("lower < upper is not fulfilled") :
missing value where TRUE/FALSE needed

@ekenah
Copy link
Owner

ekenah commented Dec 21, 2017 via email

@yushuf
Copy link
Author

yushuf commented Dec 21, 2017 via email

@ekenah
Copy link
Owner

ekenah commented Dec 21, 2017 via email

@yushuf
Copy link
Author

yushuf commented Dec 22, 2017 via email

@ekenah
Copy link
Owner

ekenah commented Dec 22, 2017 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants