Skip to content

Commit

Permalink
2023-04-14-1610
Browse files Browse the repository at this point in the history
  • Loading branch information
myaseen committed Apr 14, 2023
1 parent 0ed6f1a commit fadce1f
Show file tree
Hide file tree
Showing 21 changed files with 389 additions and 231 deletions.
28 changes: 12 additions & 16 deletions R/Exam4.3.1.R
Original file line number Diff line number Diff line change
Expand Up @@ -24,17 +24,16 @@
#'
#' @examples
#'
#' data(DataExam4.3.1)
#' data(DataExam4.3)
#' library(tidyverse)
#' library(ggplot2)
#'
#' # Pg. 51
#'
#' # Pg. 57
#' fm4.4 <-
#' aov(
#' formula = Percent ~ Replication + Pretreatment*SeedLot
#' , data = DataExam4.3.1 %>%
#' filter(Pretreatment != "Control")
#' formula = Percent ~ Repl + Treat*SeedLot
#' , data = DataExam4.3 %>%
#' filter(Treat != "control")
#' # , subset
#' # , weights
#' # , na.action
Expand All @@ -48,19 +47,16 @@
#' )
#'
#'
#' # Pg. 54
#' # Pg. 57
#' anova(fm4.4)
#'
#' library(supernova)
#'
#' supernova(fm4.4)
#' model.tables(x = fm4.4, type = "means")
#'
#' library(emmeans)
#'
#'
#' emmeans(
#' object = fm4.4
#' , specs = ~ Pretreatment
#' , specs = ~ Treat
#' , by = NULL
#' , fac.reduce = function(coefs) apply(coefs, 2, mean)
#' , contr =
Expand All @@ -72,7 +68,7 @@
#'
#' emmip(
#' object = fm4.4
#' , formula = ~ Pretreatment
#' , formula = ~ Treat
#' , type = c("link", "response", "predict.type")[1]
#' , CIs = c(TRUE, FALSE)[1]
#' , PIs = c(TRUE, FALSE)[2]
Expand Down Expand Up @@ -110,7 +106,7 @@
#'
#' emmeans(
#' object = fm4.4
#' , specs = ~ Pretreatment * SeedLot
#' , specs = ~ Treat * SeedLot
#' , by = NULL
#' , fac.reduce = function(coefs) apply(coefs, 2, mean)
#' , contr =
Expand All @@ -122,7 +118,7 @@
#'
#' emmip(
#' object = fm4.4
#' , formula = SeedLot ~ Pretreatment
#' , formula = SeedLot ~ Treat
#' , type = c("link", "response", "predict.type")[1]
#' , CIs = c(TRUE, FALSE)[1]
#' , PIs = c(TRUE, FALSE)[2]
Expand All @@ -136,7 +132,7 @@
#'
#' emmip(
#' object = fm4.4
#' , formula = Pretreatment ~ SeedLot
#' , formula = Treat ~ SeedLot
#' , type = c("link", "response", "predict.type")[1]
#' , CIs = c(TRUE, FALSE)[1]
#' , PIs = c(TRUE, FALSE)[2]
Expand Down
33 changes: 20 additions & 13 deletions R/Exam4.3.R
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,21 @@
#' library(tidyverse)
#' library(ggplot2)
#'
#'
#' # Pg.
#'
#' DataExam4.3 <-
#' DataExam4.3 %>%
#' mutate(
#' Row = as_factor(Row)
#' , Column = as_factor(Column)
#' , Replication = as_factor(Replication)
#' , SeedLot = as_factor(SeedLot)
#' )
#'
#' # Pg. 50
#' fm4.2 <-
#' aov(
#' formula = Percent ~ Replication + Contcomp + SeedLot +
#' Pretreatment/Contcomp + Contcomp /SeedLot +
#' Pretreatment/ Contcomp/SeedLot
#' formula = Percent ~ Repl + Contcomp + SeedLot +
#' Treat/Contcomp + Contcomp /SeedLot +
#' Treat/ Contcomp/SeedLot
#' , data = DataExam4.3
#' # , subset
#' # , weights
Expand All @@ -47,15 +54,15 @@
#' , singular.ok = TRUE
#' , contrasts = NULL
#' )
#'
#' # Pg. 54
#' anova(fm4.2)
#'
#' library(supernova)
#'
#' supernova(fm4.2)
#' # Pg. 50
#' model.tables(x = fm4.2, type = "means")
#'
#' library(emmeans)
#'
#'
#' emmeans(
#' object = fm4.2
#' , specs = ~ Contcomp
Expand Down Expand Up @@ -84,7 +91,7 @@
#'
#' emmeans(
#' object = fm4.2
#' , specs = ~ Contcomp + Pretreatment
#' , specs = ~ Contcomp + Treat
#' , by = NULL
#' , fac.reduce = function(coefs) apply(coefs, 2, mean)
#' , contr =
Expand All @@ -96,7 +103,7 @@
#'
#' emmip(
#' object = fm4.2
#' , formula = Contcomp ~ Pretreatment
#' , formula = Contcomp ~ Treat
#' , type = c("link", "response", "predict.type")[1]
#' , CIs = c(TRUE, FALSE)[1]
#' , PIs = c(TRUE, FALSE)[2]
Expand Down Expand Up @@ -158,7 +165,7 @@
#' theme_classic()
#'
#' DataExam4.3 %>%
#' dplyr::group_by(Pretreatment,Contcomp,SeedLot) %>%
#' dplyr::group_by(Treat, Contcomp, SeedLot) %>%
#' dplyr::summarize(Mean=mean(Percent))
#' RESFIT <- data.frame(residualvalue=residuals(fm4.2),fittedvalue=fitted.values(fm4.2))
#' ggplot(mapping = aes(x = fitted.values(fm4.2), y = residuals(fm4.2)))+
Expand Down
13 changes: 8 additions & 5 deletions R/Exam4.4.R
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,9 @@
#' library(ggplot2)
#' library(dae)
#'
#' fm4.6 <- aov(
#' # Pg. 58
#' fm4.6 <-
#' aov(
#' formula = Height ~ Rep + Irrig*Ferti*SeedDLot +
#' Error(Rep/Irrig:Ferti)
#' , data = DataExam4.4
Expand All @@ -47,13 +49,14 @@
#' , singular.ok = TRUE
#' , contrasts = NULL
#' )
#' summary(fm4.6)
#'
#' library(supernova)
#'
#' supernova(fm4.6)
#' # Pg. 61
#' summary(fm4.6)
#'
#' # Pg. 61
#' model.tables(x = fm4.6, type = "means")
#'
#' # Pg. 61
#' emmeans(
#' object = fm4.6
#' , specs = ~ Irrig
Expand Down
Binary file modified data/DataExam4.3.RData
Binary file not shown.
2 changes: 1 addition & 1 deletion docs/pkgdown.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ pandoc: 2.19.2
pkgdown: 2.0.7
pkgdown_sha: ~
articles: {}
last_built: 2023-04-13T17:37Z
last_built: 2023-04-14T11:09Z
urls:
reference: https://myaseen208.github.io/eda4treeR/reference
article: https://myaseen208.github.io/eda4treeR/articles
Expand Down
Binary file modified docs/reference/Exam4.3-1.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/reference/Exam4.3-2.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/reference/Exam4.3-3.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/reference/Exam4.3-4.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/reference/Exam4.3-5.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/reference/Exam4.3.1-1.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/reference/Exam4.3.1-2.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/reference/Exam4.3.1-3.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/reference/Exam4.3.1-4.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit fadce1f

Please sign in to comment.