Hi! Help please! I have a table with variables "speciality", "city", and "status". I need to compare frequency of cardiology-smokers from NY and from Texas using Chi-square. How I can do it? Or I need to use other test?
HTML Code:
[CODE]
* Example generated by -dataex-. To install: ssc install dataex
clear
input float(sex id) long speciality double city long status
2  7 7 1 2
1 17 2 1 1
2 11 6 1 2
1 18 7 1 2
1  6 7 1 2
2 23 3 1 1
1  9 8 1 2
1 22 3 1 1
1 20 4 1 1
1  3 2 1 2
1 12 1 1 1
1  1 2 1 1
2 13 7 1 2
1  2 4 1 1
1 21 6 1 1
2 10 6 1 1
1  4 2 2 2
1 14 7 2 2
1 16 2 2 2
1  8 8 2 1
2  5 7 2 1
1 15 2 2 1
2 19 6 2 2
1 24 5 2 2
1 17 2 1 1
1  2 4 1 1
1 16 1 2 2
end
label values speciality speciality
label def speciality 1 "cardilogy", modify
label def speciality 2 "cardiology", modify
label def speciality 3 "dantist", modify
label def speciality 4 "dermatology", modify
label def speciality 5 "endocrinology", modify
label def speciality 6 "intmed", modify
label def speciality 7 "oncology", modify
label def speciality 8 "ophtalmology", modify
label values city city
label def city 1 "NY", modify
label def city 2 "Texas", modify
label values status status
label def status 1 "non_smoker", modify
label def status 2 "smoker", modify
[/CODE]