Can I transer my health center dataset to a client level dataset to conduct ANOVA?

#1
I have 10 adolescents clinics (10 observations). I have data regarding the number of adolescent general visits and adolescent sexual and reproductive health (SRH) visits stratify by race. General visits are all visits regardless of service provide and SRH visits are only those visits were SRH services were provide. My goal is to see if there is a significant variation in the proportion of SRH visits among race. That is if whites are more like to have a SRH visits than blacks, for instance. How can I do that if I have clinical level data? This is how mu dataset looks like.
ID total_visits black_visits White_visits total_SRH_visits black_SRH_visits white_SRH_visits

I just divided the SRH visits by general visits. FOr instance, if center 1 reported to have 100 white general visits and only 20 of those visits were SRH visits. I said 20% of all the visits by Hispanic adolescents were SRH visits. In my real data I see that only 6% of all Hispanic visits received SRH services, as opposed of 89 % for whites. I would like to say that this difference is significant but I do not know what statistical test to use and even if I can do it since I have a cenetr level data, not client level.

Please help. I need to present this...

Thanks
Marvin
 

bukharin

RoboStataRaptor
#2
Re: Can I transer my helath ceneter dataset to a client level dataset to conduct ANOV

I would -reshape- the dataset into long format with four rows per clinic - white SRH, white non-SRH, black SRH, black non-SRH - and then run a fixed-effects logistic regression. I can't really see how ANOVA would be useful here given it's a binary outcome.
 
#3
Re: Can I transer my helath ceneter dataset to a client level dataset to conduct ANOV

COuld you please write an example of how this dataset would look like, please? I would appreciate it. Thanks!
 

bukharin

RoboStataRaptor
#4
Re: Can I transer my helath ceneter dataset to a client level dataset to conduct ANOV

Code:
    clinic   black   srh   count  
         1       0     0      20  
         1       0     1      30  
         1       1     0      10  
         1       1     1      60
Then you would run:
Code:
expand count
xtset clinic
xtlogit srh black, fe
 
#5
Re: Can I transer my helath ceneter dataset to a client level dataset to conduct ANOV

I am sorry it is my first time reshaping a dataset. I attached my actual data-set. In reality, I have 4 race categories (black, white, Hispanic and other) Please can you help me with this?

Thank you,,,
 
#6
Re: Can I transer my helath ceneter dataset to a client level dataset to conduct ANOV

I would like to learn by an example. I have no idea how to do this. PLease anyone!!?
 

bukharin

RoboStataRaptor
#7
Re: Can I transer my helath ceneter dataset to a client level dataset to conduct ANOV

Code:
rename q25male_nosrh_visits_hispanic srh0race0
rename q25male_srh_visits_hispanic_tota srh1race0
rename q25male_nosrh_visits_black srh0race1
rename q25male_srh_visits_black_total srh1race1
rename q25male_nosrh_visits_white srh0race2
rename q25male_srh_visits_white_total srh1race2
rename q25male_nosrh_visits_other srh0race3
rename q25male_srh_visits_other_total srh1race3
reshape long srh0race srh1race, i(id) j(race)
rename srh0race count0
rename srh1race count1
reshape long count, i(id race) j(srh)
You have a problem with cell D21.

I couldn't get the -xtlogit- models to converge, which I think is because you have a lot of cells with small numbers. Anyway see how you go with the -reshape- and we can go from there.
 
#8
Re: Can I transer my helath ceneter dataset to a client level dataset to conduct ANOV

Hi Bukharin,

I will try this today and try to understand what you did. I will get back to you asap. A thousand thanks again!
 
#9
Re: Can I transer my helath ceneter dataset to a client level dataset to conduct ANOV

cool.. I got it... so what should be the next step.. the regression?
 

bukharin

RoboStataRaptor
#10
Re: Can I transer my helath ceneter dataset to a client level dataset to conduct ANOV

Yep... as a first step run a simple logistic regression:
Code:
logistic srh i.race
In general with clustered data I would then go on to run either a random effects or fixed effects model... but in your case it doesn't converge, I think because you have so many low cell counts. So perhaps the simplest option would be to add ", vce(cluster id)" to adjust the standard error for the clustering.
 
#11
Re: Can I transer my helath ceneter dataset to a client level dataset to conduct ANOV

umn.. this is what I get after running the logistic regression


. logistic srh i.race

Logistic regression Number of obs = 296
LR chi2(3) = -0.00
Prob > chi2 = 1.0000
Log likelihood = -205.17157 Pseudo R2 = -0.0000

------------------------------------------------------------------------------
srh | Odds Ratio Std. Err. z P>|z| [95% Conf. Interval]
-------------+----------------------------------------------------------------
race |
1 | 1 .328798 0.00 1.000 .5249605 1.904905
2 | 1 .328798 0.00 1.000 .5249605 1.904905
3 | 1 .328798 0.00 1.000 .5249605 1.904905
|
_cons | 1 .2324953 0.00 1.000 .6340152 1.577249
------------------------------------------------------------------------------

How do I add ", vce(cluster id)" to adjust the standard error for the clustering?
 

bukharin

RoboStataRaptor
#12
Re: Can I transer my helath ceneter dataset to a client level dataset to conduct ANOV

You need to tell Stata to use frequency weights:
Code:
logistic srh i.race [fw=count], vce(cluster id)
 
#13
Re: Can I transer my helath ceneter dataset to a client level dataset to conduct ANOV

wow bro! this is so cool.. so complex.. do you know a good source to learn this. weights and this type clustering. this is my findings.


------------------------------------------------------------------------------
| Robust
srh | Odds Ratio Std. Err. z P>|z| [95% Conf. Interval]
-------------+----------------------------------------------------------------
race |
1 | 8.973186 6.058815 3.25 0.001 2.388933 33.70461
2 | 4.68051 3.187138 2.27 0.023 1.232189 17.77906
3 | 6.289596 3.359453 3.44 0.001 2.20786 17.91735
|
_cons | .0720767 .045055 -4.21 0.000 .0211695 .2454028
------------------------------------------------------------------------------
 

bukharin

RoboStataRaptor
#14
Re: Can I transer my helath ceneter dataset to a client level dataset to conduct ANOV

Right... so in the reshaping code we made race 0 Hispanic, race 1 black, race 2 white and race 3 other. Looks like everyone is more likely than Hispanics to have a "SRH" visit. Depending on what you're studying you may want to make a different race the "reference" group. You can do this using -fvset base-. Alternatively, you may want to use grand mean coding to compare each race against the "grand mean":
Code:
. contrast g.race, eform

Contrasts of marginal linear predictions

Margins      : asbalanced

------------------------------------------------
             |         df        chi2     P>chi2
-------------+----------------------------------
        race |
(0 vs mean)  |          1       11.21     0.0008
(1 vs mean)  |          1        5.63     0.0177
(2 vs mean)  |          1        0.18     0.6755
(3 vs mean)  |          1        2.04     0.1530
      Joint  |          3       14.16     0.0027
------------------------------------------------

--------------------------------------------------------------
             |     exp(b)   Std. Err.     [95% Conf. Interval]
-------------+------------------------------------------------
        race |
(0 vs mean)  |   .2480472   .1032968      .1096629    .5610595
(1 vs mean)  |   2.225774   .7508439      1.149043    4.311475
(2 vs mean)  |   1.160987   .4139238      .5772326    2.335093
(3 vs mean)  |   1.560117   .4855471      .8476996    2.871258
--------------------------------------------------------------
 
#15
Re: Can I transer my helath ceneter dataset to a client level dataset to conduct ANOV

Wow… I need to learn a lot…. do you know any good sites/ links to learn more about reshaping and weighting? also.. I can control for the practice setting type right? that is school based, family planning, primary care etc... I am predicting that latino adolescents are less likely to receive a SRH visit/care. However, I know that family planning centers are more likely to offer SRH care so people who go to these type of center are more likely to receive SRH care regardless of their race. That is why I need to control for this covariate. Perhaps, latinos go less to family planning centers than the other races and that is why they are getting less SRH care and not because of their race. I just include the variable pract_setting to the regression right?

Thank you!
 

bukharin

RoboStataRaptor
#16
Re: Can I transer my helath ceneter dataset to a client level dataset to conduct ANOV

Yes, you can just include that as a covariate. The weighting is nothing special here - it's just that the "count" variable tells Stata how many people are in each category, so the "fw=count" means "frequency weights come from the count variable". See -help weight-.

In terms of -reshape-, the usual advice I give is for people to read the official Stata PDF User's Guide - it covers just about everything you need. There are many other resources including this FAQ and this tutorial