# chi square: Support!!!

#### belfagor71

##### New Member
Hey everyone!

I am rather new to stata, I have to work with a lot of data and it gets sometimes very confusing.

I have a huge data set sample from a country and I would like to look at how school participation changes according to gender and to income.

As I am interested in attendance at the secondary level, I initially kept only people aged between 10 and 16.

keep if age > = 10 & age < = 16

then

keep if monthly_consumption < = 3200

and then I saw the number of girls and boys attending the secondary school.
the number of girls is lower but it is also true that the number of girls in the sample population is lower than that one of male.
Despite that, there could still be a significant difference between the mean of poor girls attending secondary school if compared with that one of poor boys.
The problem is I am not quite sure how to put all this together to run a chi square test.

thanks a lot!
belfagor

#### Etienne

##### New Member
Hi there,

It seems to me that what you want to test is whether the fraction of individuals attending attending secondary school is different in your two subsamples (boys and girls). So what you should use is "prtest"

Best,

Etienne

#### belfagor71

##### New Member
Hi Etienne and thanks a lot for answering!

It seems to me that what you want to test is whether the fraction of individuals attending attending secondary school is different in your two subsamples (boys and girls).
Yes and I want to see whether there is a significant difference within the large sample.
So I tried to run the prtest. Initially I generated a new variable called attending_sec, so that the tests looks only at people attending secondary school. And then I run the test.
However I tried to look on the internet to understand how to interpret this prtest. But I could not find something too clear.

According to the results I got, Pr(Z < z) = 0.0000 Pr(|Z| < |z|) = 0.0000 Pr(Z > z) = 1.0000
It looks like that there is a significative difference between the two groups. However, I do not know how to interpret the z-value z = −11.5949 :shakehead
Any suggestion?

I atteched it here:

Thanks again!

#### belfagor71

##### New Member
I see. Still not quite clear though about z value as I am not familiar with this test.
Looking again at my data, what about a Mann Whitney U test since I have categorical data and I make no assumptions on the variance?

Thanks a lot!