class_docstr: # From R
  setwd('c:/workspace')
  data <- read.csv('cpunish.csv', sep=",")
  
  library(statmod)
  library(tweedie)
  
  summary(glm(EXECUTIONS ~ INCOME + SOUTH - 1,
          family=tweedie(var.power=1, link.power=0),
          data=data))
class_docstr_tok: ["#","From","R","setwd","(","'","c",":","\/workspace","'",")","data","<","-","read.csv","(","'cpunish.csv","'",",","sep=","''",",","''",")","library","(","statmod",")","library","(","tweedie",")","summary","(","glm","(","EXECUTIONS","~","INCOME","+","SOUTH","-","1",",","family=tweedie","(","var.power=1",",","link.power=0",")",",","data=data",")",")"]
code: def __init__(self):
      resid_resp = [
          28.7231009386298,
          -0.307318358456484,
          4.19015460156576,
          -3.30975297068573,
          -4.87746969906705,
          0.285041779927669,
          0.0315071085472043,
          -6.33304532673002,
          -1.02436294926752,
          -6.9340610414309,
          -0.859055122126197,
          -0.736490247380883,
          -6.96145354225969,
          -1.13750232106315,
          -0.778363801217565,
          -0.636042191521576,
          -0.839322392162821,
      ]
      resid_dev = [
          7.30513948467594,
          -0.101296157943519,
          2.44987904003561,
          -1.34021826264378,
          -1.99062116973315,
          0.212014827300475,
          0.0223969676885324,
          -2.63775728156667,
          -0.798884085657077,
          -3.11862021596631,
          -0.691356293575324,
          -0.607658243497501,
          -3.12628915913493,
          -0.869326536299756,
          -0.636663290048755,
          -0.536212950673418,
          -0.67812263418512,
      ]
      resid_pear = [
          9.98383729954486,
          -0.100734032611758,
          3.11465040934513,
          -1.22417704160631,
          -1.73780566805242,
          0.217661565866984,
          0.0224564769560215,
          -2.19386916576256,
          -0.719962160947025,
          -2.46172701579962,
          -0.630049829146329,
          -0.558895774299477,
          -2.4671965358931,
          -0.778034748813176,
          -0.583676657782738,
          -0.497265896656757,
          -0.61887064145702,
      ]
      resid_work = [
          3.47027319357873,
          -0.0330190014589175,
          2.31520029566659,
          -0.452785885372436,
          -0.619167053050639,
          0.166209168591668,
          0.0160057009522403,
          -0.759991705123147,
          -0.506017436072008,
          -0.873961141113221,
          -0.46209233491888,
          -0.424125760851072,
          -0.874394795536774,
          -0.532164250702372,
          -0.437685360377137,
          -0.388768819543728,
          -0.456321521305397,
      ]
      self.resid_response = resid_resp
      self.resid_deviance = resid_dev
      self.resid_working = resid_work
      self.resid_pearson = resid_pear
      # self.null_deviance = 3731.85161919 # N/A
      self.params = [1.65700638623525e-05, 1.54257997850499]
      self.bse = [1.81044999017907e-05, 0.725739640176733]
      # self.aic_R = 522.14215776 # R adds 2 for dof to AIC
      # self.aic_Stata = 7.459173652869477  # stata divides by nobs
      # self.deviance = 70.6652992116034   # from Stata
      self.deviance = 95.0325613464258  # from R
      # self.scale = 1.0
      # self.llf = -250.0710778504317  # from Stata, ours with scale=1
      # self.bic_Stata = -179.9959200693088  # no bic in R?
      self.df_model = 1
      self.df_resid = 15
  
      # TODO: taken from Stata; not available in sm yet
      # self.chi2 = 2699.138063147485
  
      self.fittedvalues = [
          8.27689906137016,
          9.30731835845648,
          1.80984539843424,
          7.30975297068573,
          7.87746969906705,
          1.71495822007233,
          1.9684928914528,
          8.33304532673002,
          2.02436294926752,
          7.9340610414309,
          1.8590551221262,
          1.73649024738088,
          7.96145354225969,
          2.13750232106315,
          1.77836380121756,
          1.63604219152158,
          1.83932239216282,
      ]
  
imports: import os
  import numpy
  import pandas
  from statsmodels.api import add_constant
  from statsmodels.genmod.tests.results import glm_test_resids
label_desc: Use image node_id 1 to create a new CpunishTweedieLog1 object  with example: obj = CpunishTweedieLog1()