t-test help- what is the IV???

I did an experiment where I got data on children’s playmate choices (like if they chose to play with boys or girls or both or neither). My hypothesis was that they would play with children of the same gender more than the opposite gender.

There are 4 options (same-gender, opposite, mixed, alone) and each time the child played with those they got a 1- the children’s gender was also recorded. So for the same-gender column there are x incidences of children (of either gender) playing with same-gender peers, etc..

So I did an independent samples t-test comparing the same-gender choice to the opposite-gender choice because I want to know if they chose to play with same-gender significantly more than opposite. But I don’t know what the independent variable is. Is it gender? I feel like it isn’t though because I am not comparing if girls played with same-gender more than boys. So I’m thinking maybe I used the wrong test… or worse still maybe I can’t do this at all. I’m so confused. Can you help me? Please?? Thanks


TS Contributor
For each subject you have 4 measurements (number of same-sex episodes, number of opposite-sex episodes etc.). You want to compare two of these measurements. So this is a repeated-measures design. The are no groups, no t-test for independent samples. You could use dependent samples t-test, if its assumptions are met. Or, alternatively, maybe Wilcoxon signed rank test.

With kind regards

I would simply suggest to test the proportion (of 1:s or 0:s, same gender of diferent) and test if it is significantly different from 0.5

You can do a z-test or a confidence interval. A t-test is not really appropriate.

There is no grouping or independent variable. This case corresponds to a situation of just estimating the intercept and no grouping variable.

(It can be done as Karabiner suggest above, but in my view, I think this is easier.)
Ok great thanks! I ran a z test on excel and it worked (yay) but for a z test don't you need to know the variance for the population? I used the variance from my spss output from before but I *think* that's the variance from the sample, right? So the z I got probably isn't measuring what it's supposed to be measuring? :confused:
I'm sorry if these are really stupid questions...
What I am thinking I'll do is:
Make a new variable for playmate's gender. So if a girl played with a same-gender playmate, that will be recorded as female playmate. Then I will run an independent samples t-test comparing if there's a difference between how often girls play with girls compared to boys playing with girls (and vice versa). Then the IV is gender and the DV is playmate's gender. Is that a statistically good idea?
Estimate the proportions.

Let p be the estimated proportion. That is the sum of playing-with-the-same-gender divided by total sample size n.

p +/- 1.96*sqrt(p*(1-p)/n)

That will give you the estimated proportion and and a 95% confidence interval.

(t-test is not relevant.)


TS Contributor
I would simply suggest to test the proportion (of 1:s or 0:s, same gender of diferent) and test if it is significantly different from 0.5
Do you mean to treat each episode as independent observation?
But each subject could have multiple episodes. E.g. child A may
have had 12 same-sex episodes and 4 opposite-sex episodes,
while children B to D may have had 1 same-sex and 3 opposite-sex
episodes. The ratio of same-sex versus opposite sex episodes
would be 15:13, but ratio of preferences 1:3.

With kind regards

Maybe I didn't read the original post carefully enough. :)

I thought that the case was if the child played "in general" with the same or different gender.

If there are several episodes for each child then it will be a more complicated situation as Karabiner says.