Comments (5)
from jm.
I installed JM from github by following codes. Unfortunately, the problem remained. I restarted R and got no luck.
Please help. Thanks!
from jm.
from jm.
Problem solved. It works fine with R version 4.0.2.
Thanks for the great package!
from jm.
I think it is something related to how you extract the coefficients of the survreg object.
Previously, if you fit a model like this "init.fit <- survreg(Surv(Time, d) ~ ., data = SpD.i)"
you can use init.fit$coefs get the coeffcients, but now you have to use init.fit$coefficients to get the coefficients. If you revise this in the initial.surv function, the problem will be solved
if (method == "spline-PH-GH" || method == "spline-PH-Laplace") {
if (is.null(extra$strata)) {
dat <- data.frame(Time = Time, d = d, as.data.frame(WW))
rn <- tapply(row.names(dat), idT, tail, 1)
ind <- row.names(dat) %in% rn
dat <- dat[ind, ]
init.fit <- survreg(Surv(Time, d) ~ ., data = dat)
coefs <- init.fit$coef
xi <- 1 / init.fit$scale
phi <- exp(coefs[1])
logh <- -log(phi * xi * dat$Time^(xi - 1))
out$gammas.bs <- as.vector(lm.fit(extra$W2[ind, ], logh)$coefficients)
} else {
dat <- data.frame(Time = Time, d = d)
dat <- cbind(dat, as.data.frame(WW))
strata <- extra$strata
split.dat <- split(dat, strata)
gg <- NULL
for (i in seq_along(split.dat)) {
ii <- strata == levels(strata)[i]
SpD.i <- split.dat[[i]]
idT.i <- idT[ii]
W2.i <- extra$W2[ii, ]
rn <- tapply(row.names(SpD.i), idT.i, tail, 1)
ind <- row.names(SpD.i) %in% rn
SpD.i <- SpD.i[ind, ]
init.fit <- survreg(Surv(Time, d) ~ ., data = SpD.i)
coefs <- init.fit$coefficients # change coefs to coefficients
xi <- 1 / init.fit$scale
phi <- exp(coefs[1])
logh <- -log(phi * xi * SpD.i$Time^(xi - 1))
gg <- c(gg, as.vector(lm.fit(W2.i[ind, ], logh)$coefficients))
}
out$gammas.bs <- gg[!is.na(gg)]
}
out
}
}
from jm.
Related Issues (20)
- Confusing point estimates for association parameters in current values + current slopes model HOT 5
- Potential bug in survfitJM.jointModel.R HOT 2
- error when applying weight function to ins()
- Error in aeqSurv(Y) : aeqSurv exception, an interval has effective length 0 HOT 1
- Query on getting back association parameter from data simulation in weibull-ph-agh
- Error in if (w_dif < specs$tol || iter == specs$maxiter) break : missing value where TRUE/FALSE needed
- Error in if (w_dif < specs$tol || iter == specs$maxiter) break : missing value where TRUE/FALSE needed
- Simulating data and GLMMPQL using JM
- issues in running survfitJM
- Error in aeqSurv(Y) : aeqSurv exception, an interval has effective length 0
- Error in d * log.hazard + log.survival : non-conformable arrays In addition: Warning message: In wk * rep(x$P, each = nk) : longer object length is not a multiple of shorter object length HOT 3
- Error in optim(thetas, opt.survPC, gr.survPC, method = "BFGS", control = list(maxit = if (it < : non-finite value supplied by optim HOT 3
- `survfitJM` expects newdata to be ordered by subject, and by time within each subject, else things go wrong
- Error in in optim(thetas, LogLik.splineGH, Score.splineGH, method = "BFGS", HOT 1
- ***caught segfault*** caused by Error in names(fit$coef) <- cname : 'names' attribute [4] must be the same length as the vector [2] HOT 5
- problem running fuction jointModel() in JM package HOT 1
- problem running fuction jointModel() in JM package with method = "Cox-PH-aGH" option HOT 1
- Question about the calculation of standard deviation in the "random effects parameterization"
- Extract fitted lme object from the jointModel HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from jm.