I want to standardize the variables of a biological dataset. I need to run glm's, glm.nb's and lm's using different response variables but the same explanatory variables.
The dataset contains counts of a given tree species by plots (all the plots have the same size) and a series of categorical variables: vegetation type, soil type and presence/absence of cattle.
This is an example of the kind of dataset that I have:
set.seed(1234) dat <- data.frame(Plot_ID = 1:80, Ct_tree = sample(x = 1:400, replace = T), Veg = as.factor(sample(x = c("Dry", "Wet", "Mixed"), size = 80, replace = T)), Soil = as.factor(sample(x = c("Clay", "Sandy", "Rocky"), size = 80, replace = T)), Cattle = as.factor(rep(x = c(0, 1), each = 5)))
As all the explanatory variables are categorical, I'm not sure whether it is possible to produce standardized lm models with standardized coefficients and standard errors. I cannot standardize the explanatory variables above using scale() from base R because I get an error as they are non-numeric.
1) Is there a way to standardize explanatory categorical (factors) variables?
2) Can I standardize the response variables instead using scale() or the standardize R package?
3) If I standardize the response variables, how do I interpret the regression coefficients? In addition, When the response variable is abundance (absence/presence as 0/1 respectively), standardizing them will remove their binary values so I will not be able to apply a binomial family.
4) Is it statistically correct to recode the categorical variables as ordinal (e.g. Soil = 0 for clay, 1 for sandy, 2 for rocky), scale them and then apply the regression models to their rescaled values?