Hi Statalist members,
I am having difficulty in testing a difference of proportion. I am currently using a nationally representative dataset (thus svy command) and interested in the use of nicotine product (either cigarettes or e-cigarettes) in school. The group I want to analyze is dual users (using both cigarettes and e-cigarettes product). My aim is to know whether there was a difference in the prevalence of using cigarettes vs e-cigarettes in school among dual users (so I am thinking of using chi-square test).
Using svy: proportion command, I already have the proportion of use of their respective products in schools among dual users (cigarettes: 61.47% and e-cigarette: 95.98%). However I am unable to test whether the proportion between the two product use in school are different. I am wondering how could I test it?
Attached below is a fraction of my dataset. Any help would be greatly appreciated. Thank you very much.
I am having difficulty in testing a difference of proportion. I am currently using a nationally representative dataset (thus svy command) and interested in the use of nicotine product (either cigarettes or e-cigarettes) in school. The group I want to analyze is dual users (using both cigarettes and e-cigarettes product). My aim is to know whether there was a difference in the prevalence of using cigarettes vs e-cigarettes in school among dual users (so I am thinking of using chi-square test).
Using svy: proportion command, I already have the proportion of use of their respective products in schools among dual users (cigarettes: 61.47% and e-cigarette: 95.98%). However I am unable to test whether the proportion between the two product use in school are different. I am wondering how could I test it?
Attached below is a fraction of my dataset. Any help would be greatly appreciated. Thank you very much.
Code:
* Example generated by -dataex-. To install: ssc install dataex clear input float(Smokers Vapers Smoke_School Vape_School Survey_Weight Unique_ID usergroup) 1 0 1 . 2734.12 1 1 0 1 . 1 3498.22 2 2 1 0 1 . 130.29 3 1 1 0 1 . 1231.22 4 1 1 1 0 1 490.43 5 3 1 1 1 1 2342.11 6 3 0 1 . 0 3453.56 7 2 0 1 . 0 636.78 8 2 1 1 1 1 2956.23 9 3 0 1 . 1 3453.22 10 2 0 1 . 1 2341.19 11 2 0 1 . 0 3458.54 12 2 1 0 0 . 1989.24 13 1 1 0 0 . 2312.33 14 1 1 1 0 1 3432.11 15 3 1 0 0 . 657.45 16 1 1 1 0 0 456.94 17 3 1 0 1 . 357.23 18 1 0 1 . 0 689.23 19 2 1 1 1 1 1423.12 20 3 0 1 . 1 2425.23 21 2 1 0 0 . 2345.11 22 1 0 1 . 1 1632.12 23 2 0 1 . 0 1982.12 24 2 1 1 1 1 267.42 25 3 1 0 0 . 1838.38 26 1 end label values Smokers var1 label def var1 0 "No", modify label def var1 1 "Yes", modify label values Vapers Vapers label def Vapers 0 "No", modify label def Vapers 1 "Yes", modify label values Smoke_School Smoke_Private label def Smoke_Private 0 "No", modify label def Smoke_Private 1 "Yes", modify label values Vape_School Vape_Private label def Vape_Private 0 "No", modify label def Vape_Private 1 "Yes", modify label values usergroup usergroup label def usergroup 1 "Exclusive Smokers", modify label def usergroup 2 "Exclusive Vapers", modify label def usergroup 3 "Dual Users", modify
Comment