Learn more  » Push, build, and install  RubyGems npm packages Python packages Maven artifacts PHP packages Go Modules Bower components Debian packages RPM packages NuGet packages

alkaline-ml / statsmodels   python

Repository URL to install this package:

Version: 0.11.1 

/ discrete / tests / results / results_count_robust_cluster.py

import numpy as np

from statsmodels.tools.testing import ParamsTableTestBunch

est = dict(
           rank=3,
           N=34,
           ic=1,
           k=3,
           k_eq=1,
           k_dv=1,
           converged=1,
           rc=0,
           k_autoCns=0,
           N_clust=5,
           ll=-354.2436413025559,
           k_eq_model=1,
           ll_0=-356.2029100704882,
           df_m=2,
           chi2=5.204189583786304,
           p=.0741181533729996,
           r2_p=.0055004288638308,
           cmdline="poisson accident yr_con op_75_79, vce(cluster ship)",
           cmd="poisson",
           predict="poisso_p",
           estat_cmd="poisson_estat",
           gof="poiss_g",
           chi2type="Wald",
           opt="moptimize",
           vcetype="Robust",
           clustvar="ship",
           vce="cluster",
           title="Poisson regression",
           user="poiss_lf",
           crittype="log pseudolikelihood",
           ml_method="e2",
           singularHmethod="m-marquardt",
           technique="nr",
           which="max",
           depvar="accident",
           properties="b V",
          )

params_table = np.array([
    -.02172061893549,  .19933709357097, -.10896426022065,  .91323083771076,
    -.41241414311748,  .36897290524649, np.nan,  1.9599639845401,
    0,  .22148585072024,  .11093628220713,  1.9965140918162,
    .04587799343723,  .00405473301549,  .43891696842499, np.nan,
    1.9599639845401,                0,  2.2697077143215,  1.1048569901548,
    2.054299999499,  .03994666479943,  .10422780555076,  4.4351876230922,
    np.nan,  1.9599639845401,                0]).reshape(3, 9)

params_table_colnames = 'b se z pvalue ll ul df crit eform'.split()

params_table_rownames = 'yr_con op_75_79 _cons'.split()

cov = np.array([
    .03973527687332,  .00976206273414, -.21171095768584,  .00976206273414,
    .01230685870994, -.06297293767114, -.21171095768584, -.06297293767114,
    1.2207089686939]).reshape(3, 3)

cov_colnames = 'yr_con op_75_79 _cons'.split()

cov_rownames = 'yr_con op_75_79 _cons'.split()


results_poisson_clu = ParamsTableTestBunch(
                params_table=params_table,
                params_table_colnames=params_table_colnames,
                params_table_rownames=params_table_rownames,
                cov=cov,
                cov_colnames=cov_colnames,
                cov_rownames=cov_rownames,
                **est
                )

est = dict(
           rank=3,
           N=34,
           ic=1,
           k=3,
           k_eq=1,
           k_dv=1,
           converged=1,
           rc=0,
           k_autoCns=0,
           ll=-354.2436413025559,
           k_eq_model=1,
           ll_0=-356.2029100704882,
           df_m=2,
           chi2=.1635672212515404,
           p=.9214713337295277,
           r2_p=.0055004288638308,
           cmdline="poisson accident yr_con op_75_79, vce(robust)",
           cmd="poisson",
           predict="poisso_p",
           estat_cmd="poisson_estat",
           gof="poiss_g",
           chi2type="Wald",
           opt="moptimize",
           vcetype="Robust",
           vce="robust",
           title="Poisson regression",
           user="poiss_lf",
           crittype="log pseudolikelihood",
           ml_method="e2",
           singularHmethod="m-marquardt",
           technique="nr",
           which="max",
           depvar="accident",
           properties="b V",
          )

params_table = np.array([
    -.02172061893549,  .19233713248134, -.11292993014545,  .91008610728406,
    -.39869447148862,  .35525323361764, np.nan,  1.9599639845401,
    0,  .22148585072024,  .55301404772037,    .400506735106,
    .68878332380143,  -.8624017657564,  1.3053734671969, np.nan,
    1.9599639845401,                0,  2.2697077143215,  .66532523368388,
    3.4114258702533,  .00064624070669,  .96569421829539,  3.5737212103476,
    np.nan,  1.9599639845401,                0]).reshape(3, 9)

params_table_colnames = 'b se z pvalue ll ul df crit eform'.split()

params_table_rownames = 'yr_con op_75_79 _cons'.split()

cov = np.array([
    .03699357253114, -.01521223175214, -.09585501859714, -.01521223175214,
    .30582453697607,  -.1649339692102, -.09585501859714,  -.1649339692102,
    .44265766657651]).reshape(3, 3)

cov_colnames = 'yr_con op_75_79 _cons'.split()

cov_rownames = 'yr_con op_75_79 _cons'.split()


results_poisson_hc1 = ParamsTableTestBunch(
                params_table=params_table,
                params_table_colnames=params_table_colnames,
                params_table_rownames=params_table_rownames,
                cov=cov,
                cov_colnames=cov_colnames,
                cov_rownames=cov_rownames,
                **est
                )

est = dict(
           rank=3,
           N=34,
           ic=4,
           k=3,
           k_eq=1,
           k_dv=1,
           converged=1,
           rc=0,
           k_autoCns=0,
           ll=-91.28727940081573,
           k_eq_model=1,
           ll_0=-122.0974139280415,
           df_m=2,
           chi2=61.62026905445154,
           p=4.16225408420e-14,
           r2_p=.2523405986746273,
           cmdline="poisson accident yr_con op_75_79, exposure(service)",
           cmd="poisson",
           predict="poisso_p",
           estat_cmd="poisson_estat",
           offset="ln(service)",
           gof="poiss_g",
           chi2type="LR",
           opt="moptimize",
           vce="oim",
           title="Poisson regression",
           user="poiss_lf",
           crittype="log likelihood",
           ml_method="e2",
           singularHmethod="m-marquardt",
           technique="nr",
           which="max",
           depvar="accident",
           properties="b V",
          )

params_table = np.array([
    .30633819450439,  .05790831365493,   5.290055523458,  1.222792336e-07,
    .19283998533528,   .4198364036735, np.nan,  1.9599639845401,
    0,  .35592229608495,  .12151759298719,  2.9289775030556,
    .00340079035234,  .11775219034206,  .59409240182785, np.nan,
    1.9599639845401,                0,  -6.974712802772,  .13252425018256,
    -52.629709605328,                0,  -7.234455560208,  -6.714970045336,
    np.nan,  1.9599639845401,                0]).reshape(3, 9)

params_table_colnames = 'b se z pvalue ll ul df crit eform'.split()

params_table_rownames = 'yr_con op_75_79 _cons'.split()

cov = np.array([
    .00335337279036, -.00315267340017, -.00589654294427, -.00315267340017,
    .0147665254054, -.00165060980569, -.00589654294427, -.00165060980569,
    .01756267688645]).reshape(3, 3)

cov_colnames = 'yr_con op_75_79 _cons'.split()

cov_rownames = 'yr_con op_75_79 _cons'.split()


results_poisson_exposure_nonrobust = ParamsTableTestBunch(
                params_table=params_table,
                params_table_colnames=params_table_colnames,
                params_table_rownames=params_table_rownames,
                cov=cov,
                cov_colnames=cov_colnames,
                cov_rownames=cov_rownames,
                **est
                )

est = dict(
           rank=3,
           N=34,
           ic=4,
           k=3,
           k_eq=1,
           k_dv=1,
           converged=1,
           rc=0,
           k_autoCns=0,
           ll=-91.28727940081573,
           k_eq_model=1,
           ll_0=-122.0974139280415,
           df_m=2,
           chi2=15.1822804640621,
           p=.0005049050167458,
           r2_p=.2523405986746273,
           cmdline="poisson accident yr_con op_75_79, exposure(service) vce(robust)",  # noqa:E501
           cmd="poisson",
           predict="poisso_p",
           estat_cmd="poisson_estat",
           offset="ln(service)",
           gof="poiss_g",
           chi2type="Wald",
           opt="moptimize",
           vcetype="Robust",
           vce="robust",
           title="Poisson regression",
           user="poiss_lf",
           crittype="log pseudolikelihood",
           ml_method="e2",
           singularHmethod="m-marquardt",
           technique="nr",
           which="max",
           depvar="accident",
           properties="b V",
          )

params_table = np.array([
    .30633819450439,  .09144457613957,  3.3499875819514,  .00080815183366,
    .12711011868929,  .48556627031949, np.nan,  1.9599639845401,
    0,  .35592229608495,  .16103531267836,  2.2102127177276,
    .02709040275274,  .04029888299621,  .67154570917369, np.nan,
    1.9599639845401,                0,  -6.974712802772,   .2558675415017,
    -27.259076168227,  1.29723387e-163, -7.4762039689282, -6.4732216366159,
    np.nan,  1.9599639845401,                0]).reshape(3, 9)

params_table_colnames = 'b se z pvalue ll ul df crit eform'.split()

params_table_rownames = 'yr_con op_75_79 _cons'.split()

cov = np.array([
    .00836211050535,  .00098797681063, -.01860743122756,  .00098797681063,
    .02593237192942, -.02395236210603, -.01860743122756, -.02395236210603,
    .06546819879413]).reshape(3, 3)

cov_colnames = 'yr_con op_75_79 _cons'.split()

cov_rownames = 'yr_con op_75_79 _cons'.split()


results_poisson_exposure_hc1 = ParamsTableTestBunch(
                params_table=params_table,
                params_table_colnames=params_table_colnames,
                params_table_rownames=params_table_rownames,
                cov=cov,
                cov_colnames=cov_colnames,
                cov_rownames=cov_rownames,
                **est
                )

est = dict(
           rank=3,
           N=34,
           ic=4,
           k=3,
           k_eq=1,
           k_dv=1,
           converged=1,
           rc=0,
           k_autoCns=0,
           N_clust=5,
           ll=-91.28727940081573,
           k_eq_model=1,
           ll_0=-122.0974139280415,
           df_m=2,
           chi2=340.7343047354823,
           p=1.02443835269e-74,
           r2_p=.2523405986746273,
           cmdline="poisson accident yr_con op_75_79, exposure(service) vce(cluster ship)",  # noqa:E501
           cmd="poisson",
           predict="poisso_p",
           estat_cmd="poisson_estat",
           offset="ln(service)",
           gof="poiss_g",
           chi2type="Wald",
           opt="moptimize",
           vcetype="Robust",
           clustvar="ship",
           vce="cluster",
           title="Poisson regression",
           user="poiss_lf",
           crittype="log pseudolikelihood",
           ml_method="e2",
           singularHmethod="m-marquardt",
           technique="nr",
           which="max",
           depvar="accident",
           properties="b V",
          )

params_table = np.array([
    .30633819450439,  .03817694295902,  8.0241677504982,  1.022165435e-15,
    .23151276126487,  .38116362774391, np.nan,  1.9599639845401,
    0,  .35592229608495,  .09213163536669,  3.8631930787765,
    .00011191448109,  .17534760892947,  .53649698324044, np.nan,
    1.9599639845401,                0,  -6.974712802772,   .0968656626603,
    -72.003975518463,                0, -7.1645660129248, -6.7848595926192,
    np.nan,  1.9599639845401,                0]).reshape(3, 9)

params_table_colnames = 'b se z pvalue ll ul df crit eform'.split()

params_table_rownames = 'yr_con op_75_79 _cons'.split()

cov = np.array([
    .0014574789737, -.00277745275086,  .00108765624666, -.00277745275086,
    .00848823823534, -.00469929607507,  .00108765624666, -.00469929607507,
    .00938295660262]).reshape(3, 3)
Loading ...