Skip to content
Snippets Groups Projects
Commit 02cab083 authored by Maria Voigt's avatar Maria Voigt
Browse files

fixing temporarly interaction and quadratic term

there is a problem with a way I coded this for two or more terms in
interaction and quadratic,
with only one it doesn't work
I need to find out what the problem is
parent f3fd5a4e
No related branches found
No related tags found
No related merge requests found
......@@ -63,14 +63,16 @@ coeffs[is.na(coeffs) == T] <- 0
# CODE THIS
# here only separate after first _
predictor_names_coeffs <- gsub("coeff_","", names(coeffs))
interaction_terms_names <- predictor_names_coeffs[predictor_names_coeffs %in%
paste0("year:", predictor_names_coeffs)]
interaction_terms_names <- gsub("year:", "", interaction_terms_names)
quadratic_terms_names <- predictor_names_coeffs[predictor_names_coeffs %in%
paste0("I(", predictor_names_coeffs, "^2)")]
quadratic_terms_names <- gsub("I\\(|\\^2\\)", "", quadratic_terms_names )
#UNDERSTAND HERE WHAT IS HAPPENING
#interaction_terms_names <- predictor_names_coeffs[predictor_names_coeffs %in%
# paste0("year:", predictor_names_coeffs)]
#interaction_terms_names <- gsub("year:", "", interaction_terms_names)
#quadratic_terms_names <- predictor_names_coeffs[predictor_names_coeffs %in%
# paste0("I(", predictor_names_coeffs, "^2)")]
#quadratic_terms_names <- gsub("I\\(|\\^2\\)", "", quadratic_terms_names )
interaction_terms_names <- c("human_pop_dens")
quadratic_terms_names <- c("rain_dry")
predictor_names_coeffs <- predictor_names_coeffs[predictor_names_coeffs != "(Intercept)"]
# don't include interaction or quadratic term
predictor_names <- predictor_names_coeffs[!grepl("I(*)", predictor_names_coeffs)]
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment