When running the Elixhauser model, I get a KeyError: 'quan'
This happens when using the default weighting for the Elixhauser score as in:
df_elix = comorbidity(df, score="elixhauser") #KeyError: 'quan'
It also happens when specifying the weighting="quan":
df_elix = comorbidity(df, score="elixhauser", icd="icd10", variant="quan", weighting="quan") #KeyError: 'quan'
However, specifying a weighting="vw" works fine:
df_elix = comorbidity(df, score="elixhauser", icd="icd10", variant="quan", weighting="vw") #works fine
What I Did
df_elix = comorbidity(df, score="elixhauser")
Traceback (most recent call last):
Cell In[41], line 1
df_elix = comorbidity(df, score="elixhauser")
File C:\ProgramData\Anaconda3\envs\rob\Lib\site-packages\comorbidipy\calculator.py:142 in comorbidity
dfp = _calculate_weighted_score(dfp, score_icd_variant, assign0, weighting)
File C:\ProgramData\Anaconda3\envs\rob\Lib\site-packages\comorbidipy\calculator.py:32 in _calculate_weighted_score
w = weights[param_score][weighting]
KeyError: 'quan'
df_elix = comorbidity(df, score="elixhauser", icd="icd10", variant="quan", weighting="quan")
Traceback (most recent call last):
Cell In[38], line 1
df_elix = comorbidity(df, score="elixhauser", icd="icd10", variant="quan", weighting="quan")
File C:\ProgramData\Anaconda3\envs\rob\Lib\site-packages\comorbidipy\calculator.py:142 in comorbidity
dfp = _calculate_weighted_score(dfp, score_icd_variant, assign0, weighting)
File C:\ProgramData\Anaconda3\envs\rob\Lib\site-packages\comorbidipy\calculator.py:32 in _calculate_weighted_score
w = weights[param_score][weighting]
KeyError: 'quan'
Description
When running the Elixhauser model, I get a KeyError: 'quan'
This happens when using the default weighting for the Elixhauser score as in:
df_elix = comorbidity(df, score="elixhauser") #KeyError: 'quan'
It also happens when specifying the weighting="quan":
df_elix = comorbidity(df, score="elixhauser", icd="icd10", variant="quan", weighting="quan") #KeyError: 'quan'
However, specifying a weighting="vw" works fine:
df_elix = comorbidity(df, score="elixhauser", icd="icd10", variant="quan", weighting="vw") #works fine
What I Did