Below are the solutions to these exercises on “GLM – Part 4.” if (!require(car)){install.packages(car, dep=T)} library(car) if (!require(MuMIn)){install.packages(MuMIn, dep=T)} ## Warning: package ‘MuMIn’ was built under R version 3.4.4 library(MuMIn) spider<-read.csv(file.choose()) ############### # # # Exercise 1 # # # ############### # Visualise the data table(spider$PA) ## ## 0 1 ## 9 10 op <- […]
Rstats
Basic Generalized Linear Modeling – Part 3: Solutions
Below are the solutions to these exercises on “GLM – Part 3.” Please note, you need to execute the answer in this exercise, along with the solutions of Basic GLM Exercises – Part 2 here. ############### # # # Exercise 9 # # # ############### Road.nb1 <- glm.nb(TOT.N ~ OPEN.L + MONT.S + POLIC + […]
Basic Generalized Linear Modeling – Part 2: Exercises
In this exercise, we will try to handle the model that has been over-dispersed using the quasi-Poisson model. Over-dispersion simply means that the variance is greater than the mean. It’s important because it leads to inflation in the models and increases the possibility of Type I errors. We will use a data-set on amphibian road […]
Basic Generalized Linear Modeling – Part 2: Solutions
Below are the solutions to these exercises on “GLM – Part 2.” if (!require(car)){install.packages(car, dep=T)} library(car) ############### # # # Exercise 1 # # # ############### rm(list=ls()) Road<-read.csv(file.choose()) plot(Road$D.PARK,Road$TOT.N,xlab=”Distance to park”, ylab=”Road kills”) ############### # # # Exercise 2 # # # ############### Road.glm1<-glm(TOT.N~D.PARK,family=poisson,data=Road) summary(Road.glm1) ## ## Call: ## glm(formula = TOT.N ~ D.PARK, family […]
Modeling With ANCOVA – Part 2: Solutions
Below are the solutions to these exercises on “ANCOVA – Part 2.” if (!require(car)){install.packages(car, dep=T)} library(car) if (!require(ggplot2)){install.packages(ggplot2, dep=T)} library(ggplot2) ############### # # # Exercise 1 # # # ############### # Load data limpet<-read.csv(file.choose()) limpet.lm <- lm(EGGS ~ DENSITY * SEASON, data = limpet) ############### # # # Exercise 2 # # # ############### predict(limpet.lm) […]
Modeling With ANCOVA – Part 1: Exercises
In the previous exercise on the #REcology series, we learned how to define the impact of one explanatory variable to another response variable. In a real practice, particularly in experimental or observational design, explanatory variables are often found to be more than one. Thus, it needs a new determination to analyze the data-set and generate […]
Groups Comparison With ANOVA: Exercises (Part 2)
On this 2nd part of groups comparison exercise, we will focus on nested ANOVA application in R, particularly the application on ecology. This is the last part of groups comparison exercise.Previous exercise can be found here Answers to the exercises are available here. If you obtained a different (correct) answer than those listed on the […]
Groups Comparison With ANOVA: Solutions (Part 2)
Below are the solutions to these exercises on Two way ANOVA. if (!require(car)){install.packages(car, dep=T)} ## Warning: package ‘car’ was built under R version 3.3.2 library(car) if (!require(ggplot2)){install.packages(ggplot2, dep=T)} ## Warning: package ‘ggplot2’ was built under R version 3.3.3 library(ggplot2) if (!require(dplyr)){install.packages(dplyr, dep=T)} ## Warning: package ‘dplyr’ was built under R version 3.3.3 library(dplyr) if (!require(lattice)){install.packages(lattice, […]
Groups Comparison with ANOVA: Exercises (Part 1)
As we’re aware, the growth of data science has been increased recently, and successfully applied on research for decision making or creating baseline conditions. Statistical analysis, including data visualization, exploration, and modeling are three main important elements in data science. In this exercise, we’ll learn how to analyze response and explanatory variables of data that […]
Groups Comparison with ANOVA: Solutions (Part 1)
Below are the solutions to these exercises on “Two Way ANOVA’s.” if (!require(car)){install.packages(car, dep=T)} ## Warning: package ‘car’ was built under R version 3.3.2 library(car) if (!require(ggplot2)){install.packages(ggplot2, dep=T)} ## Warning: package ‘ggplot2’ was built under R version 3.3.3 library(ggplot2) if (!require(dplyr)){install.packages(dplyr, dep=T)} ## Warning: package ‘dplyr’ was built under R version 3.3.3 library(dplyr) if (!require(lattice)){install.packages(lattice, […]