1
$\begingroup$

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.

$\endgroup$
  • 1
    $\begingroup$ 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. $\endgroup$ – StatsStudent Nov 10 '18 at 19:06
  • $\begingroup$ 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 ?. $\endgroup$ – Subhash C. Davar Nov 17 '18 at 1:31
  • $\begingroup$ 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. $\endgroup$ – Subhash C. Davar Nov 17 '18 at 1:37
  • $\begingroup$ 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. $\endgroup$ – Cairan Van Rooyen Nov 18 '18 at 8:50
0
$\begingroup$

This is panel data, as clarified in edit 1. That means that you should investigate possible autocorrelation in the daily CVs (it would be very strange if there is no autocorrelation). That must be taken care of in any model.

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.

But it seems to me like none of your covariables varies with time (they are constant for each building), which maybe simplifies. An extra variable like ambient temperature (varying with time) could be interesting.

$\endgroup$
  • 1
    $\begingroup$ Hi. So 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. $\endgroup$ – Cairan Van Rooyen Nov 10 '18 at 20:19
  • 1
    $\begingroup$ I have plotted quite a number of visuals from the data, but Im now trying to carry out analysis on the data to determine in hard numbers, which independent variables affect the dependent most. Im sorry, I am not able to share visuals as the data is restricted. I also wish to determine the highest and lowest CV for each independent variable to try establish a narrative for the reporting $\endgroup$ – Cairan Van Rooyen Nov 10 '18 at 20:36
  • $\begingroup$ Indeed a number of my variables are ordinal, not all catagorical, apologies for any confusion. So DBL_GLAZ, BUILDING_AGE, HhdSize and Inc_Group_7s are ordinal $\endgroup$ – Cairan Van Rooyen Nov 18 '18 at 9:04

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.