Skip to content

Commit

Permalink
PS model working?
Browse files Browse the repository at this point in the history
implementing parsurv methods

Update parsurvival.jl

Update parsurvival.jl

Update parsurvival.jl

Update parsurvival.jl

update for chi2 test

tweaks for parsurv

Update parsurvival.jl
  • Loading branch information
alexpkeil1 committed Sep 19, 2023
1 parent 2ffb60f commit 8d83af1
Show file tree
Hide file tree
Showing 5 changed files with 401 additions and 39 deletions.
3 changes: 2 additions & 1 deletion Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,10 @@ StatsBase = "2913bbd2-ae8a-5f71-8c99-4fb6c76f3a91"
StatsModels = "3eaba693-59b7-5ba5-a881-562e759f1c8d"
Tables = "bd369af6-aec1-5ad0-b16a-f7cc5008161c"
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
Zygote = "e88e6eb3-aa80-5325-afca-941959d7151f"

[compat]
Documenter = "0.20 - 0.30"
Documenter = "0.20 - 0.30,1"
RecipesBase = "^1"
Reexport = "^1"
StatsBase = "^0.34"
Expand Down
3 changes: 3 additions & 0 deletions src/LSurvival.jl
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ using RecipesBase
using Reexport
using Printf
using Random, LinearAlgebra, Tables
using Zygote
#using Distributions
#import Distributions: Chisq, Normal
import SpecialFunctions: gamma_inc, erfinv, erf
Expand Down Expand Up @@ -75,6 +76,7 @@ export AbstractPH,
export kaplan_meier, # interface for estimating cumulative risk from non-parametric estimator
aalen_johansen, # interface for estimating cumulative risk from non-parametric competing risk estimator
coxph, # interface for Cox model
survreg, # interface for parametric survival model
risk_from_coxphmodels, # interface for estimating cumulative risk from hazard specific Cox models
# deprecated
coxmodel, # (deprecated) interface for Cox model
Expand Down Expand Up @@ -170,6 +172,7 @@ abstract type AbstractSurvDist end
include("shared_structs.jl")
include("distributions.jl")
include("coxmodel.jl")
include("parsurvival.jl")
include("residuals.jl")
include("npsurvival.jl")
include("data_generators.jl")
Expand Down
6 changes: 3 additions & 3 deletions src/examples.jl
Original file line number Diff line number Diff line change
Expand Up @@ -874,11 +874,11 @@ jres.RL[2]
###################################################################
# checking parametric survival against R
###################################################################

using RCall
@rput dat1
R"""
library(survival)
res = survreg(Surv(time , status) ~ x,data = dat1, dist="weibull")
summary(res)
ret = summary(res)
"""
@rget res
@rget ret
Loading

0 comments on commit 8d83af1

Please sign in to comment.