WOLFRAM

Enable JavaScript to interact with content and submit forms on Wolfram websites. Learn how
Wolfram Language & System Documentation Center

StrataVariables

is an option for fitting functions such as CoxModelFit that specify the variables on which the model should be stratified.

Details
Details and Options Details and Options
Examples  
Basic Examples  
See Also
Related Guides
History
Cite this Page

StrataVariables

is an option for fitting functions such as CoxModelFit that specify the variables on which the model should be stratified.

Details

  • Strata variables are used to divide a non-homogeneous population into homogeneous subgroups. Stratification is often useful in proportional hazards modeling where the assumption of proportional hazards between subgroups may be suspect.
  • Possible settings for StrataVariables include:
  • None treat no variables as strata
    {v1,v2,} treat the variables vi as strata
  • Models with a strata variable v with p levels {s1,,sp} effectively group the input data into p groups corresponding to the si.
  • With multiple strata variables v1, , vk with pvi levels, the input data is grouped into at most pvi groups, dropping empty subgroups.

Examples

Basic Examples  (2)

Define some data:

Wolfram Language code: x = {{67, "Red"}, {11, "Blue"}, {32, "Blue"}, {50, "Red"}, {65, "Red"}, {44, "Red"}, {20, "Red"}, {26, "Blue"}, {69, "Red"}, {50, "Red"}, {25, "Red"}, {18, "Blue"}, {63, "Red"}, {41, "Blue"}, {30, "Blue"}, {32, "Red"}, {46, "Red"}, {35, "Blue"}, {33, "Blue"}, {22, "Blue"}}; y = EventData[{8, 22, 6, 4, 12, 11, 2, 34, 25, 15, 8, 6, 34, 6, 32, 1, 15, 9, 9, 6}, {0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 1, 1, 1, 0, 0, 1, 1, 0}];

Fit the data, treating the second variable as a strata variable:

Wolfram Language code: mod = CoxModelFit[{x, y}, {a}, {a, b}, StrataVariables -> b]

One stratum is created for each level in the data:

Wolfram Language code: mod["StrataSummary"]

A parameter summary table:

Wolfram Language code: mod["ParameterTable"]

Fit a model with more than one strata variable:

Wolfram Language code: x = {{"dog", "no"}, {"dog", "no"}, {"dog", "no"}, {"dog", "no"}, {"dog", "no"}, {"dog", "yes"}, {"dog", "no"}, {"cat", "no"}, {"dog", "no"}, {"dog", "no"}, {"cat", "yes"}, {"dog", "no"}, {"dog", "no"}, {"cat", "yes"}, {"cat", "yes"}, {"dog", "no"}, {"cat", "no"}, {"dog", "yes"}, {"cat", "no"}, {"cat", "no"}, {"cat", "yes"}, {"cat", "yes"}, {"dog", "yes"}, {"dog", "no"}, {"dog", "yes"}}; y = EventData[{20, 14, 20, 92, 1, 90, 5, 11, 15, 41, 60, 4, 2, 66, 21, 3, 18, 32, 33, 36, 6, 55, 134, 7, 15}];
Wolfram Language code: mod = CoxModelFit[{x, y}, {}, {a, b}, StrataVariables -> {a, b}]

All non-empty combinations of the strata variables are used:

Wolfram Language code: mod["StrataSummary"]

Baseline survival rates for the strata:

Wolfram Language code: Plot[Evaluate@Table[mod["SF"][i][t], {i, Union[x]}], {t, 0, 40}, Exclusions -> None, PlotPoints -> 100]
Wolfram Research (2012), StrataVariables, Wolfram Language function, https://reference.wolfram.com/language/ref/StrataVariables.html.

Text

Wolfram Research (2012), StrataVariables, Wolfram Language function, https://reference.wolfram.com/language/ref/StrataVariables.html.

CMS

Wolfram Language. 2012. "StrataVariables." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/StrataVariables.html.

APA

Wolfram Language. (2012). StrataVariables. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/StrataVariables.html

BibTeX

@misc{reference.wolfram_2026_stratavariables, author="Wolfram Research", title="{StrataVariables}", year="2012", howpublished="\url{https://reference.wolfram.com/language/ref/StrataVariables.html}", note=[Accessed: 14-August-2026]}

BibLaTeX

@online{reference.wolfram_2026_stratavariables, organization={Wolfram Research}, title={StrataVariables}, year={2012}, url={https://reference.wolfram.com/language/ref/StrataVariables.html}, note=[Accessed: 14-August-2026]}

Top [フレーム]

AltStyle によって変換されたページ (->オリジナル) /