I have two data sets (two different countries), and for each data set I have 3 variables: 2 independents (years and car model), 1 dependent (sales)
To make it more visual it would look something like this:
Country 1
Car_Model Year Sales
A 1 100
A 2 200
B 1 80
B 2 90
C 1 66
C 2 20
Country 2
Car_Model Year Sales
A 1 120
A 2 220
B 1 82
B 2 92
C 1 62
C 2 22
I have been asked to perform a t-test to check if there is a significant difference between countries, but taking into consideration the variable car_model and year. However, I can not understand if it is possible to perform a t-test in such a problem, and which kind of t-test should I perform or how I should use the variables.
I think the idea here is to check the significant difference of model A in country 1 against model A in country 2, then model B in country 1 against model B in country 2, and so on. And at the end get a p value based on those previous p values. Is it possible to do this using a t-test in R/SPSS?
t.test, ast.testcan statistically compare (the averages of) 2 groups (i.e. vectors) without taking into account any other info. You can perform multiplet.tests for each combination ofCarandYear, but that would be tough if you have lots of combinations. What people typically look for when they say something like what you've described is the output of something likelm(Sales ~ Country + Car + Year), where you can interpret the p-value of theCountrycoefficient, when controlling forYearandCar. – AntoniosK Aug 21 '18 at 12:34