# Statistical significance testing for multiple categorical variables: modeling coefficient of variation of temperature inside houses

I am a beginner in R (and stats), so please excuse the simple nature of my question.

I have a range of variables all relating to the physical and social characteristics of households in the UK. I am investigating the variation of temperatures inside houses. So I have calculated the coefficient of variation, which is my main dependent variable (continuous).

Now I need to test which of the selected independent variables are significant in explaining the differences in the coefficients of variation.

Structure of my data

'data.frame':   24225 obs. of  13 variables:
$$SiteID : Factor w/ 280 levels This is a unique identifier for each house$$ GOR           : Factor w/ 9 levels
This is region in UK
$$ACCOM_EHCS : num Type of house$$ DBL_GLAZ      : int
If the house has double glazing
$$BUILDING_AGE : int Age of the house$$ HhdSize       : int
Number of occupants
$$Inc_Group_7s : int Income$$ Person_Under_5: int
Person under 5yrs old
$$Person_Over_64: int Person over 64 yrs old$$ Date          : Date, format:
$$Daily_SD : num Calculated standard deviation$$ Daily_mean    : num
Calculated daily mean
$CV : num Calculated co-efficient of variation  Problem I am looking to test all independent variables: GOR, ACCOM_EHCS, DBL_GLAZ, BUILDING_AGE, HhdSize, Inc_Group_7s, Person_Under_5, Person_Over_64 with CV (co-efficient of variation), to test which of the selected independent variables (8no) are significant in explaining the differences in the coefficients of variation. I am comfortable with linear regression of two continuous variables, but this is quite different with 8no independent categorical variables and one continuous variable defining the co-efficient of variation. Question 1. What is the best way of testing all the independent categorical variables against the one dependent continuous variable to determine which of the independent categorical variables affect the dependent variable the most? For example: I want to test if households with or without occupants under 5 (yes/no catagorical variable) years old have a statistically significant impact on the co-efficient of variation (continuous calculated dependent variable). I hope this makes sense... I think in this situation that I also need to be careful of multicollinearity. This data is sensitive, so I cannot share the data itself. Edit 1 The internal temperature was measured every 45 minutes for around 6 months in 280 houses. I have since limited the temperature data for November to February - as this roughly represents the heating season here in the UK. I calculated the daily standard deviation and daily mean and from this calculated the daily coefficient of variation. Maybe not obvious, but all of the above variables are discrete categories that define characteristics of the households with a number - for example DBL_GLAZ contains 5 categories 1 through 5 that each define the amount of double glazing that household has. Edit 2 The above double glazing example - 1 is all windows double glazed, 2 is most, 3 is some, 4 is few and 5 is none. • I think you're better off using a multiple regression analysis where you regress temperature onto all of your independent variables simultaneously. You can then determine which variable contribute to changes in temperature, while adjusting for the presence of the other variables in your model. Using your model's results, you can then determine the largest absolute change in temperature for one unit change in your dependent variable by simply examining the value of each statistically significant coefficient ($\hat{\beta}\$). Keep in mind though, the units of measurement may be different. – StatsStudent Nov 10 '18 at 19:06
• You seem to be interested in households across U.K. i .e. England, Scotland Wales and Nothern Ireland. Does your sample data reflects all areas ?. Alternatively, your sample is restricted ?. – Subhash C. Davar Nov 17 '18 at 1:31
• You can identify key factors first and nove ahead with linear regression if the variables are continuous or scaled correctly. I shall write about the issues in detail if you post response to my quarries. – Subhash C. Davar Nov 17 '18 at 1:37
• I am interested in households throughout England, not the whole of the UK. The sample is representative of these areas. None of my variables are continuous, hence the problem. – Cairan Van Rooyen Nov 18 '18 at 8:50

Then, you could start with some visualization, maybe add some of that to the post. Then you will be better of with some multivariable regression model than testing each variable individually. But which regression model? Since CV is necessarily nonnegative (and probably positive), maybe use log transformed CV, or maybe better, a normal glm (generalized linear model) with log link function. This leaves out how to handle the panel model aspects, which could depend on your answers on questions above. In R I would start out with package pglm (with which I have no experience) for panel glm's. Or use nlme or lme4.
About your predictor variables: You say all are categorical. But some (like age) is at least ordinal, and you say DBL_GLAZ contains 5 categories 1 through 5 that each define the amount of double glazing that household has. That sounds to me like a numerical variable, or at least ordinal, so think more about the representation of your covariables. After OP's edit 2: Such a scale seems open to misinterpretation/use, what is few? I would try to use it as ordinal (represented by integers 1,2,3,4,5) maybe with linear+quadratic terms. But still check the linearity, try with an alternative model with dummy encoding, and switch to that if much better fit. Maybe.