forked from statsmodels/statsmodels
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request statsmodels#1825 from josef-pkt/phreg_1312_rebased
ENH: Cox Proportional Hazard Model, Phreg rebased closes statsmodels#1312
- Loading branch information
Showing
21 changed files
with
3,886 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,81 @@ | ||
.. currentmodule:: statsmodels.duration.hazard_regression | ||
|
||
|
||
.. _duration: | ||
|
||
Models for Survival and Duration Analysis | ||
========================================= | ||
|
||
currently contains Cox's Proportional Hazard Model. | ||
|
||
|
||
Examples | ||
-------- | ||
|
||
:: | ||
|
||
url = "http://vincentarelbundock.github.io/Rdatasets/csv/survival/flchain.csv" | ||
data = pd.read_csv(url) | ||
del data["chapter"] | ||
data = data.dropna() | ||
data["lam"] = data["lambda"] | ||
data["female"] = 1*(data["sex"] == "F") | ||
data["year"] = data["sample.yr"] - min(data["sample.yr"]) | ||
|
||
status = np.asarray(data["death"]) | ||
mod = PHreg.from_formula("futime ~ 0 + age + female + creatinine + " + | ||
"np.sqrt(kappa) + np.sqrt(lam) + year + mgus", | ||
data, status=status, ties="efron") | ||
rslt = mod.fit() | ||
print(rslt.summary()) | ||
|
||
Detailed examples can be found here: | ||
|
||
.. toctree:: | ||
:maxdepth: 2 | ||
|
||
examples/notebooks/generated/ not yet | ||
|
||
There some notebook examples on the Wiki: | ||
`Wiki notebooks for PHReg and Survival Analysis <https://github.com/statsmodels/statsmodels/wiki/Examples#survival-analysis>`_ | ||
|
||
|
||
|
||
Technical Documentation | ||
----------------------- | ||
|
||
TODO | ||
|
||
|
||
References | ||
^^^^^^^^^^ | ||
|
||
References for Cox proportional hazards regression model:: | ||
|
||
T Therneau (1996). Extending the Cox model. Technical report. | ||
http://www.mayo.edu/research/documents/biostat-58pdf/DOC-10027288 | ||
|
||
G Rodriguez (2005). Non-parametric estimation in survival models. | ||
http://data.princeton.edu/pop509/NonParametricSurvival.pdf | ||
|
||
B Gillespie (2006). Checking the assumptions in the Cox proportional | ||
hazards model. | ||
http://www.mwsug.org/proceedings/2006/stats/MWSUG-2006-SD08.pdf | ||
|
||
|
||
Module Reference | ||
---------------- | ||
|
||
The model class is: | ||
|
||
.. autosummary:: | ||
:toctree: generated/ | ||
|
||
PHReg | ||
|
||
The result classe is: | ||
|
||
.. autosummary:: | ||
:toctree: generated/ | ||
|
||
PHRegResults |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -97,6 +97,7 @@ Table of Contents | |
discretemod | ||
anova | ||
tsa | ||
duration | ||
stats | ||
nonparametric | ||
gmm | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
Oops, something went wrong.