I have this code that keeps throwing "Invalid Chi2"
Where am I wrong please?
Code:
local varie_effect "Variety_increase_drudgery, Variety_decrease_drudgery, Displace_women, trait_inc_qlnty, Employement_Inc_Maint, input_diff_access, trait_inc_qlnty"

foreach x of local varie_effect{
    bys Sex: tabulate Selected_variety1 `x', chi2 column
}
This is my data

Code:
* Example generated by -dataex-. To install: ssc install dataex
clear
input byte(Selected_variety1 Variety_increase_drudgery Variety_decrease_drudgery trait_inc_qlnty Employement_Inc_Maint input_diff_access trait_inc_qlnty)
13 2 1 1 1 1 1
 3 2 1 1 1 1 1
 3 2 1 1 2 1 1
13 2 1 1 1 1 1
 3 2 1 1 1 1 1
 3 2 1 1 1 2 1
 3 1 1 1 1 1 1
 3 1 1 1 1 1 1
 3 2 1 1 1 1 1
 3 1 1 1 1 1 1
 3 2 1 1 1 1 1
 3 2 1 1 1 1 1
 3 2 1 2 1 1 2
13 2 1 1 1 1 1
 1 2 1 1 1 1 1
end
label values Selected_variety1 Selected_variety1
label def Selected_variety1 1 "Mwitemania", modify
label def Selected_variety1 3 "Nyota", modify
label def Selected_variety1 13 "Angaza", modify
label values Variety_increase_drudgery Variety_increase_drudgery
label def Variety_increase_drudgery 1 "Yes", modify
label def Variety_increase_drudgery 2 "No", modify
label values Variety_decrease_drudgery Variety_decrease_drudgery
label def Variety_decrease_drudgery 1 "Yes", modify
label values trait_inc_qlnty trait_inc_qlnty
label def trait_inc_qlnty 1 "Yes", modify
label def trait_inc_qlnty 2 "No", modify
label values Employement_Inc_Maint Employement_Inc_Maint
label def Employement_Inc_Maint 1 "Yes", modify
label def Employement_Inc_Maint 2 "No", modify
label values input_diff_access input_diff_access
label def input_diff_access 1 "Yes", modify
label def input_diff_access 2 "No", modify