Skip to content

Commit

Permalink
Add in adjustedresponse as imputation_value and update test data
Browse files Browse the repository at this point in the history
  • Loading branch information
NathanKelly-ONS committed Jan 9, 2025
1 parent 7d1c5bf commit 71f5ba6
Show file tree
Hide file tree
Showing 5 changed files with 57 additions and 51 deletions.
3 changes: 3 additions & 0 deletions mbs_results/outputs/pivot_imputation_value.py
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,7 @@ def format_imputation_link(df):
"imputation_link",
"imputation_flags_adjustedresponse",
"count_imps",
"adjustedresponse"
]
]

Expand All @@ -176,7 +177,9 @@ def format_imputation_link(df):
"questioncode": "Question",
"imputation_flags_adjustedresponse": "link_type",
"count_imps": "Count_imps",
"adjustedresponse": "Imputation_value"
}
)

return renamed_df

Original file line number Diff line number Diff line change
@@ -1,13 +1,16 @@
questioncode,cellnumber,cell_no,frosic2007,imputation_class,f_link_adjustedresponse,f_match_adjustedresponse_pair_count,b_link_adjustedresponse,construction_link,imputation_flags_adjustedresponse,imputation_link
4,600,600,40000,250,1,1.424345,1.23214,4.123034,fic,1
5,700,700,50000,100,0.65423421,0.8532432,0.7504535,10.23466432,fic,0.65423421
3,500,500,30000,500,1,0,1.3454653,100.2130214,bir,1.3454653
4,600,600,40000,250,1,1.424345,1.23214,4.123034,bir,1.23214
5,700,700,50000,100,0.65423421,0.8532432,0.7504535,10.23466432,fir,0.65423421
3,500,500,30000,500,1,0,1.3454653,100.2130214,fir,1
4,600,600,40000,250,1,1.424345,1.23214,4.123034,c,4.123034
5,700,700,50000,100,0.65423421,0.8532432,0.7504535,10.23466432,c,10.23466432
4,600,600,40000,250,1,1.424345,1.23214,4.123034,fimc,1
5,700,700,50000,100,0.65423421,0.8532432,0.7504535,10.23466432,fimc,0.65423421
4,600,600,40000,250,1,1.424345,1.23214,4.123034,mc,
5,700,700,50000,100,0.65423421,0.8532432,0.7504535,10.23466432,mc,
questioncode,cellnumber,cell_no,frosic2007,imputation_class,f_link_adjustedresponse,f_match_adjustedresponse_pair_count,b_link_adjustedresponse,construction_link,imputation_flags_adjustedresponse,adjustedresponse
4,600,600,40000,250,1,1.424345,1.23214,4.123034,fic,100
5,700,700,50000,100,0.65423421,0.8532432,0.7504535,10.23466432,fic,200
3,500,500,30000,500,1,0,1.3454653,100.2130214,bir,300
4,600,600,40000,250,1,1.424345,1.23214,4.123034,bir,100
5,700,700,50000,100,0.65423421,0.8532432,0.7504535,10.23466432,fir,200
3,500,500,30000,500,1,0,1.3454653,100.2130214,fir,300
4,600,600,40000,250,1,1.424345,1.23214,4.123034,c,100
5,700,700,50000,100,0.65423421,0.8532432,0.7504535,10.23466432,c,200
4,600,600,40000,250,1,1.424345,1.23214,4.123034,fimc,300
5,700,700,50000,100,0.65423421,0.8532432,0.7504535,10.23466432,fimc,100
4,600,600,40000,250,1,1.424345,1.23214,4.123034,mc,200
5,700,700,50000,100,0.65423421,0.8532432,0.7504535,10.23466432,mc,300
5,700,700,50000,100,0.65423421,0.8532432,0.7504535,10.23466432,r,100
4,600,600,40000,250,1,1.424345,1.23214,4.123034,,200
5,700,700,50000,100,0.65423421,0.8532432,0.7504535,10.23466432,r,300
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
questioncode,cellnumber,cell_no,frosic2007,imputation_class,f_link_adjustedresponse,f_match_adjustedresponse_pair_count,b_link_adjustedresponse,construction_link,imputation_flags_adjustedresponse,imputation_link
4,600,600,40000,250,1,1.424345,1.23214,4.123034,fic,1
5,700,700,50000,100,0.65423421,0.8532432,0.7504535,10.23466432,fic,0.65423421
3,500,500,30000,500,1,0,1.3454653,100.2130214,bir,1.3454653
4,600,600,40000,250,1,1.424345,1.23214,4.123034,bir,1.23214
5,700,700,50000,100,0.65423421,0.8532432,0.7504535,10.23466432,fir,0.65423421
3,500,500,30000,500,1,0,1.3454653,100.2130214,fir,1
4,600,600,40000,250,1,1.424345,1.23214,4.123034,c,4.123034
5,700,700,50000,100,0.65423421,0.8532432,0.7504535,10.23466432,c,10.23466432
4,600,600,40000,250,1,1.424345,1.23214,4.123034,fimc,1
5,700,700,50000,100,0.65423421,0.8532432,0.7504535,10.23466432,fimc,0.65423421
4,600,600,40000,250,1,1.424345,1.23214,4.123034,mc,
5,700,700,50000,100,0.65423421,0.8532432,0.7504535,10.23466432,mc,
questioncode,cellnumber,cell_no,frosic2007,imputation_class,f_link_adjustedresponse,f_match_adjustedresponse_pair_count,b_link_adjustedresponse,construction_link,imputation_flags_adjustedresponse,adjustedresponse,imputation_link
4,600,600,40000,250,1.0,1.424345,1.23214,4.123034,fic,100,1.0
5,700,700,50000,100,0.65423421,0.8532432,0.7504535,10.23466432,fic,200,0.65423421
3,500,500,30000,500,1.0,0.0,1.3454653,100.2130214,bir,300,1.3454653
4,600,600,40000,250,1.0,1.424345,1.23214,4.123034,bir,100,1.23214
5,700,700,50000,100,0.65423421,0.8532432,0.7504535,10.23466432,fir,200,0.65423421
3,500,500,30000,500,1.0,0.0,1.3454653,100.2130214,fir,300,1.0
4,600,600,40000,250,1.0,1.424345,1.23214,4.123034,c,100,4.123034
5,700,700,50000,100,0.65423421,0.8532432,0.7504535,10.23466432,c,200,10.23466432
4,600,600,40000,250,1.0,1.424345,1.23214,4.123034,fimc,300,1.0
5,700,700,50000,100,0.65423421,0.8532432,0.7504535,10.23466432,fimc,100,0.65423421
4,600,600,40000,250,1.0,1.424345,1.23214,4.123034,mc,200,
5,700,700,50000,100,0.65423421,0.8532432,0.7504535,10.23466432,mc,300,
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
questioncode,cellnumber,cell_no,frosic2007,imputation_class,f_link_adjustedresponse,f_match_adjustedresponse_pair_count,b_link_adjustedresponse,construction_link,imputation_flags_adjustedresponse,imputation_link,count_imps
4,600,600,40000,250,1,1.424345,1.23214,4.123034,fic,1,5
5,700,700,50000,100,0.65423421,0.8532432,0.7504535,10.23466432,fic,0.65423421,5
3,500,500,30000,500,1,0,1.3454653,100.2130214,bir,1.3454653,2
4,600,600,40000,250,1,1.424345,1.23214,4.123034,bir,1.23214,5
5,700,700,50000,100,0.65423421,0.8532432,0.7504535,10.23466432,fir,0.65423421,5
3,500,500,30000,500,1,0,1.3454653,100.2130214,fir,1,2
4,600,600,40000,250,1,1.424345,1.23214,4.123034,c,4.123034,5
5,700,700,50000,100,0.65423421,0.8532432,0.7504535,10.23466432,c,10.23466432,5
4,600,600,40000,250,1,1.424345,1.23214,4.123034,fimc,1,5
5,700,700,50000,100,0.65423421,0.8532432,0.7504535,10.23466432,fimc,0.65423421,5
4,600,600,40000,250,1,1.424345,1.23214,4.123034,mc,,5
5,700,700,50000,100,0.65423421,0.8532432,0.7504535,10.23466432,mc,,5
questioncode,cellnumber,cell_no,frosic2007,imputation_class,f_link_adjustedresponse,f_match_adjustedresponse_pair_count,b_link_adjustedresponse,construction_link,imputation_flags_adjustedresponse,adjustedresponse,imputation_link,count_imps
4,600,600,40000,250,1,1.424345,1.23214,4.123034,fic,100,1,5
5,700,700,50000,100,0.65423421,0.8532432,0.7504535,10.23466432,fic,200,0.65423421,5
3,500,500,30000,500,1,0,1.3454653,100.2130214,bir,300,1.3454653,2
4,600,600,40000,250,1,1.424345,1.23214,4.123034,bir,100,1.23214,5
5,700,700,50000,100,0.65423421,0.8532432,0.7504535,10.23466432,fir,200,0.65423421,5
3,500,500,30000,500,1,0,1.3454653,100.2130214,fir,300,1,2
4,600,600,40000,250,1,1.424345,1.23214,4.123034,c,100,4.123034,5
5,700,700,50000,100,0.65423421,0.8532432,0.7504535,10.23466432,c,200,10.23466432,5
4,600,600,40000,250,1,1.424345,1.23214,4.123034,fimc,300,1,5
5,700,700,50000,100,0.65423421,0.8532432,0.7504535,10.23466432,fimc,100,0.65423421,5
4,600,600,40000,250,1,1.424345,1.23214,4.123034,mc,200,,5
5,700,700,50000,100,0.65423421,0.8532432,0.7504535,10.23466432,mc,300,,5
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
sic,cell,Question,imputation_link,link_type,Count_imps,Imputation_value
40000,600,4,1,fic,5,
50000,700,5,0.65423421,fic,5,
30000,500,3,1.3454653,bir,2,
40000,600,4,1.23214,bir,5,
50000,700,5,0.65423421,fir,5,
30000,500,3,1,fir,2,
40000,600,4,4.123034,c,5,
50000,700,5,10.23466432,c,5,
40000,600,4,1,fimc,5,
50000,700,5,0.65423421,fimc,5,
40000,600,4,,mc,5,
50000,700,5,,mc,5,
40000,600,4,1.0,fic,5,100
50000,700,5,0.65423421,fic,5,200
30000,500,3,1.3454653,bir,2,300
40000,600,4,1.23214,bir,5,100
50000,700,5,0.65423421,fir,5,200
30000,500,3,1.0,fir,2,300
40000,600,4,4.123034,c,5,100
50000,700,5,10.23466432,c,5,200
40000,600,4,1.0,fimc,5,300
50000,700,5,0.65423421,fimc,5,100
40000,600,4,,mc,5,200
50000,700,5,,mc,5,300

0 comments on commit 71f5ba6

Please sign in to comment.