# Algebra, two-sample t-statistic, variance

#### Dason

That clearly isn't the full question. There isn't enough information as it currently stands.

This looks like a homework question though. Our homework help policy can be found here. We mainly just want to see what you have tried so far and that you have put some effort into the problem. I would also suggest checking out this thread for some guidelines on smart posting behavior that can help you get answers that are better much more quickly.

#### _joey

##### New Member
It's a full question and it is from homework. I am not asking for a solution. I am only asking for guidance. Thanks for your suggestions and recommendations for checking out 'posting behaviour'

#### Dason

I'm sorry but there has to be more background than that. I don't know what the "never and ever-had steroid groups" are. Also all we're asking is that you show us what you've attempted so far.

#### _joey

##### New Member
The question above is part of the question and the information provided for this part is in full.
The question asks for a proof of t=b/s(b) is equal to two-sample t-statistic with pooled standard deviation
b is least square regression with numerator and denominator parts: http://www.efunda.com/math/leastsquares/images/y1ddevsum4.gif

The question posted above is the denominator of b and I need to show that the denominator of b is equal to n0n1/(n0+n1) where n0 and n1 are sample size.
As I said the information for the part is in full. I don't require solution to the question. I seek for guidance and hints.

#### _joey

##### New Member
I'm sorry but there has to be more background than that. I don't know what the "never and ever-had steroid groups" are. Also all we're asking is that you show us what you've attempted so far.
This information is irrelevant. Each steroid group is a sample. There are two samples in question as stated above and in the original heading of the question

#### Dason

Samples of what? Are we talking about a continuous quantity with a normal distribution? Is each X_i a binomial experiment? I still think we're missing some information.

#### _joey

##### New Member
Samples of what? Are we talking about a continuous quantity with a normal distribution? Is each X_i a binomial experiment? I still think we're missing some information.
Two sample of people. The information is irrelevant. You can assume normal distribution by CLT, however.

#### Dason

Let's say $X_1 = 1, X_2 = 2, X_3 = 3$ and $X_1, X_2$ are in the never-steroid group and $X_3$ is the ever-steroid group. Then $n_0 = 2$ and $n_1 = 1$.

Now $\sum_{i=1}^3 (X_i - \bar{X})^2 = 2$ but $\frac{n_on_1}{n} = \frac{2}{3}$

So I'm thinking there has to be more to it than given because what is given doesn't work in general.

#### Dason

Hot ****. Was that so hard? Now I know that X is actually just a dummy coded indicator variable so that if a person is in the never-steroid group $X_i = 0$ and if they're in the ever-steroid group $X_i = 1$. It could be flipped around but that is very important information.

So now we know that $\bar{X} = \frac{n_1}{n}$ and we can break the sum apart into two pieces - one piece where all the X_i are 0 and one piece where they're all 1. Have you tried this yet?

#### _joey

##### New Member
Hot ****. Was that so hard? Now I know that X is actually just a dummy coded indicator variable so that if a person is in the never-steroid group $X_i = 0$ and if they're in the ever-steroid group $X_i = 1$. It could be flipped around but that is very important information.

So now we know that $\bar{X} = \frac{n_1}{n}$ and we can break the sum apart into two pieces - one piece where all the X_i are 0 and one piece where they're all 1. Have you tried this yet?
I haven't tried this but it makes sense. Why is it $\bar{X} = \frac{n_1}{n}$ and not $\bar{X} = \frac{n_0}{n}$ ? and how can we break the sum in two parts?

I guess I need to find a good paper on dummy variable in regression model to understand the concept.

#### Dason

I haven't tried this but it makes sense. Why is it $\bar{X} = \frac{n_1}{n}$ and not $\bar{X} = \frac{n_0}{n}$ ?
That's a good question - why don't you start by computing $\bar{X}$ for this situation (instead of just taking my word for it). Working on that simpler problem will probably help build up your intuition about working with these dummy coded variables.

#### _joey

##### New Member
That's a good question - why don't you start by computing $\bar{X}$ for this situation (instead of just taking my word for it). Working on that simpler problem will probably help build up your intuition about working with these dummy coded variables.
I don't know how to apply the concept of dummy variable in solving the problem or computing $\bar{X}$ in ' a situation' . I need to read on this first.

#### _joey

##### New Member
Okay, it's easy. The key part, the hint was n1/n for ever steroid to be X_i=1

#### Dason

What have you tried so far? You'll probably want to use the result from part (i).

#### Dason

I'm not sure you need that identity. I think you should apply the result of part (i) to the denominator. For the numerator just do something similar to what you did to show part (i) by breaking it up into two pieces - the parts where X_i = 0 and the parts where X_i = 1.

#### _joey

##### New Member
I'm not sure you need that identity. I think you should apply the result of part (i) to the denominator. For the numerator just do something similar to what you did to show part (i) by breaking it up into two pieces - the parts where X_i = 0 and the parts where X_i = 1.
I am stuck with the $Y_i$ term in the numerator.

#### Dason

Note that if you break apart the sum in the numerator into two parts (one where X_i = 0 and one where X_i = 1) then the (X_i - Xbar) part is constant so you can pull it out of the sum. Also note that $\bar{Y_0} = \frac{1}{n_0}\sum Y_i$ where the sum is only over the Y_i where X_i = 0. Then if you multiply both sides of that equality by $n_0$ you get the equality $n_0\bar{Y_0} = \sum Y_i$.