tbalan / frailtyem Goto Github PK
View Code? Open in Web Editor NEWThe development version of the frailtyEM R package, that fits several types of shared frailty models
The development version of the frailtyEM R package, that fits several types of shared frailty models
The return object should be more similar to other packages. So let's get less creative
and everything goes to hell. e.g. nan's data set
autoplot not working with individual = TRUE
plot with type pred with individual = TRUE gives weird stuff
predict with individual doesn't give SEs
for theta. that should be easy somehow
hmmmmmm
also with smaller data sets it takes a long time. check out nan's 2nd data set
put frailty variance big there, it's confusing
rats2 <-
rats[rats$rx==1,]
m2 <- emfrail(formula = Surv(time, status) ~ cluster(litter),
data = rats2,
distribution = emfrail_dist(dist = "pvf"))
summary(m2)
variance is estimated as 0 of the test - check that out +
Can't calculate derivative with the Expint function
Since there is the other function for the CA test that works directly on Cox models this could be removed
putting the wrong thing into type (e.g. type = "pred") instead of conditional/marginal leaves with a dumb error:
Error in autoplot.emfrail(mod_gam_1, type = "pred", newdata = newdata[1, :
object 'plot1' not found
Clarify the documentation at least.
Issue: msm::deltamethod can't take a variable from outside (pvfm) in the formula. For this I have to build the formula outside of the deltamethod() call.
Temporarily disabled since it's not really that important, but it should be easy to fix.
Make strata() work for reaching the maximum likelihood estimator.
This has been made now in emfrail() with a bunch of mapply statements - this is of course redundant if there is no strata.
Port it to em_fit() now. Should be easy peasy, so we reach the maximum likelihood estimates (yay).
It don't work. Look into
P.S. if it comforts anyone it also doesn't work in coxph
Example: gamma variance is 0.
This leads to an estimate of log theta of about 9.5 (ok...)
And a Hessian of about 0.2, which means a standard error of about 20! That's huge! Should be smaller. You know, if I know that the log theta is actually up there....
aren't they? check if this is used to avoid redundant calculations
typo: appendix with pvf
s(m) should be in only one place
newdata argument is kind of dumb.
maybe make a baseline() thing to get a baseline individual from the original data frame?
It seems that the "slow" fit in CPP is faster and more stable than the one using R functions
it isn't documented
implement median concordance and the rest from Hougaard's book
So this would go as follows: calculate cumhaz differently (that is the essential part).
add an option individual in the prediction so we know that's what is up!
then check so that the tstart tstop don't cross
then take the breslow and multiply each part with what we have to
calculate cumulative hazard from that
bingo
go to mcgilchrist and aisbett 1991
maybe that should be removed. as in - does anyone care about that?
why make another e step during the SE? can do that earlier
Make one that also returns zz and one that DOESNT return zz so we don't calculate that all the time
investigate if that can be used
to only show certain parts
actually the whole estimation with death would work I think.
bring out the old code!
Imat: it's trying to put a 0x0 matrix
ca_test: adjusts for covariates although it shouyldnt'
Goal: adapt the Cvec_lt to using strata(). This is done in relatively the same way as with the usual Cvecs.
what the hell happens with left truncation. check whether the M step is OK the way it is.
Check the papers of: van den Berg & Drapper (final one), and the one of Jensen and others
Furthermore, a plot() method (e.g., with type = c("hist", "frail", "pred")) would be a more intuitive interface to the plot_* functions. Similarly, an autoplot() method could be added for the ggplot_* functions.
The idea is to add strata.
Problem: how to deal with the Commenges Andersen test in this case?
just have them as arguments, not as a list (pointless)
behaviour is completely expected in the catterpillar plot, but still would be nice to not have that warning.
In the full data set some patients are informatively censored by DEATH.
So it's kind of a bad example
the CA test takes a long time, and it's most likely because of my crappy programming skills. step 1 - fix the test. step 2 - fix my life
happens sometimes, when the estimate is on the border.
then expint should be overridden
Challenge: make it work with strata() statements..
should be split into two parts: one for the inner maximization one for the outer. The latter should not be sent to the maximizer as it creates useless overhead
too many digits man
update the .distribution to emfrail_dist()
LRT should be 0 but it may be slightly negative in a very weird way.
prolly because of numerical stuff
The set of methods for "emfrail" objects must be embellished. coef() and vcov() are obviously missing, logLik() and nobs() should be added, fitted() and possibly residuals() would be convenient additions. And terms(), model.matrix(), model.frame() could be useful for re-using the objects in other contexts.
When there are a lot of event time points there is a very large matrix to be inverted.
Can this be overcome and somehow just get SE for beta?
I think it should return -cumhaz no? Now it just returns -cumhaz if tstart == 0....
remove arguments that have a dot and move the syntax to function(formula, data ...)
center the covariates when estimating
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.