# Combined t test for intercept and gradient - Unequal sample sizes, equal variance

#### dan.col

##### New Member
I work in an industry where sales are related to temperature. My colleague has performed two regressions for sales:
Monday to Thursday sales= a1 + b1*Temp
Friday sales = a2 + b2*Temp

I'm trying to determine whether Friday Sales are the same as Monday to Thursday sales. By 'the same' I mean that variations between a1 and a2, and b1 and b2 are just due to random sampling. Let's say that the Null Hypothesis is that they are the same. Ideally, I would like to be able to state a confidence level such as 'we can be 95% confident that both a1=a2 and b1=b2".

There are fewer data points in the friday regression than the monday-thursday regression. The set of Temp values in the Monday to Thursday data set are interspersed with the Temp values of the Friday data set (ie. similar range, but not exactly same temperature values). By observing the data I am happy to assume that the two sales types have equal variances. By observation, it appears that the both sets of regression errors (residuals) are normally distributed.

My questions are:
1 Is it possible/does it makes sense to try to get a combined statistical measure across both sales/temperature gradient AND intercept at the same time, as opposed to doing them separately ?

2 If so, what is the procedure/formula? Is it an example of independent two-sample t tests rather than Dependent t test for paired samples, or are F tests appropriate - sorry, I'm struggling ! I'm a base SAS / Enterprise Guide user.

Daniel.

#### squareandrare

##### New Member
You want to set up an indicator variable for whether the data is from Friday or not, let's call it I(F). Then set up a model with interaction:

sales = b1 + b2*I(F) + b3*Temp + b4*I(F)*Temp + error

where the bi's are the fitted coefficients.

You want to see if b2 and b4 are significant. If just b2 is significant, the intercepts are different for Friday vs M-Th. If both b2 and b4 are significant, the intercepts and slopes are different for Friday vs M-Th.

#### dan.col

##### New Member
Squareandrare,

thanks very much. That sound you can hear is me smacking my forehead - I should have thought of this myself !

Cheers.
Daniel.