Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
Package: SGPmatrices
Type: Package
Title: Baseline Coefficient Matrices for SGP Analyses
Version: 0.1-2.0
Date: 2025-4-21
Version: 0.1-3.0
Date: 2025-12-23
Authors@R: c(person(given=c("Damian", "W."), family="Betebenner", email="dbetebenner@nciea.org", role=c("aut", "cre")),
person(given=c("Adam", "R."), family="Van Iwaarden", email="avaniwaarden@nciea.org", role="aut"))
Maintainer: Damian W. Betebenner <dbetebenner@nciea.org>
Expand Down
22 changes: 15 additions & 7 deletions R/addBaselineMatrices.R
Original file line number Diff line number Diff line change
@@ -1,26 +1,34 @@
`addBaselineMatrices` <-
function(state,
year,
add.matrices.to.which.state=NULL) {
add.matrices.to.which.state=NULL,
SGPt = FALSE) {

SGPstateData <- SGP::SGPstateData ### Needed due to assignment of values to SGPstateData

### Utility function
getMatrixLabel <- function(state, year, add.matrices.to.which.state) {
if (!paste(state, "Baseline_Matrices", sep="_") %in% names(SGPmatrices::SGPmatrices)) {
getMatrixLabel <- function(state, year, add.matrices.to.which.state, SGPt) {
ifelse(SGPt, state.label <- paste(state, "SGPt_Baseline_Matrices", sep="_"), state.label <- paste(state, "Baseline_Matrices", sep="_"))
if (!state.label %in% names(SGPmatrices::SGPmatrices)) {
stop(paste("\tNOTE: Baseline matrices for state:", state, "not in SGPmatrices. Contact package maintainer to have baseline matrices added to package."))
}
tmp.years <- names(SGPmatrices::SGPmatrices[[paste(state, "Baseline_Matrices", sep="_")]])
tmp.years <- names(SGPmatrices::SGPmatrices[[state.label]])
if (year < sort(tmp.years)[1]) stop("NOTE: Supplied year precedes years associated with baseline matrices in package. Contact package developer if you think this is in error.")
if (!year %in% tmp.years) year <- tmp.years[which(year==sort(c(tmp.years, year)))-1L]
matrix.label <- paste0("SGPmatrices::SGPmatrices[['", paste(state, "Baseline_Matrices", sep="_"), "']][['", year, "']]")
message(paste0("\tNOTE: Adding ", SGP::getStateAbbreviation(state, type="Long"), " (", state, ") ", year, " baseline matrices to SGPstateData for state ",
if (!SGPt) {
matrix.label <- paste0("SGPmatrices::SGPmatrices[['", state.label, "']][['", year, "']]")
message(paste0("\tNOTE: Adding ", SGP::getStateAbbreviation(state, type="Long"), " (", state, ") ", year, " baseline matrices to SGPstateData for state ",
add.matrices.to.which.state))
} else {
matrix.label <- paste0("SGPmatrices::SGPmatrices[['", state.label, "']][['", year, "']]")
message(paste0("\tNOTE: Adding ", SGP::getStateAbbreviation(state, type="Long"), " (", state, ") ", year, " SGPt baseline matrices to SGPstateData for state ",
add.matrices.to.which.state))
}
return(matrix.label)
}

if (is.null(add.matrices.to.which.state)) add.matrices.to.which.state <- state

SGPstateData[[add.matrices.to.which.state]][["Baseline_splineMatrix"]][["Coefficient_Matrices"]] <- eval(parse(text=getMatrixLabel(state, year, add.matrices.to.which.state)))
SGPstateData[[add.matrices.to.which.state]][["Baseline_splineMatrix"]][["Coefficient_Matrices"]] <- eval(parse(text=getMatrixLabel(state, year, add.matrices.to.which.state, SGPt)))
return(SGPstateData)
} ### END addBaselineMatrices
2 changes: 1 addition & 1 deletion R/zzz.R
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ function(libname, pkgname) {

# Define a friendly startup message
message_text <- paste0(
magenta(bold("\uD83C\uDF89 SGPmatrices v", installed.version, sep="")), " - ", toOrdinal::toOrdinalDate("2025-4-21"), "\n",
magenta(bold("\uD83C\uDF89 SGPmatrices v", installed.version, sep="")), " - ", toOrdinal::toOrdinalDate("2025-12-23"), "\n",
strrep("\u2501", 40), "\n",
bold("\U1F4E6 CRAN: "), cran.version, "\n",
bold("\U1F527 Dev: "), dev.version, "\n",
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ The baseline coefficient matrices embedded in **SGPmatrices** are updated period
* AZ_Baseline_Matrices: Contains 2021 baseline matrices for Arizona AzM2.
* CO_Baseline_Matrices: Contains 2021 baseline matrices for Colorado CMAS.
* HI_Baseline_Matrices: Contains 2021 baseline matrices for Hawaii SBA.
* HI_SGPt_Baseline_Matrices: Contains 2021 SGPt time-dependent baseline matrices for Hawaii SBA.
* IN_Baseline_Matrices: Contains 2021 baseline matrices for Indiana ILEARN/ISTEP+.
* MA_Baseline_Matrices: Contains 2021 baseline matrices for Massachusetts MCAS 2.0/PARCC.
* MI_Baseline_Matrices: Contains 2021 baseline matrices for Michigan MSTEP/PSAT/SAT.
Expand Down
Binary file modified data/SGPmatrices.rda
Binary file not shown.
4 changes: 2 additions & 2 deletions inst/CITATION
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ citEntry(entry = "Manual",
title = "{SGPmatrices}: Baseline coefficient matrices for SGP analyses.",
author = "Damian W. Betebenner and Adam R. Van Iwaarden",
year = "2025",
note = "R package version 0.1-2.0",
note = "R package version 0.1-3.0",
url = "https://github.com/CenterForAssessment/SGPmatrices/",

textVersion = paste("Damian W. Betebenner and Adam R. Van Iwaarden (2025).",
"SGPmatrices: Baseline coefficient matrices for SGP analyses.",
"(R package version 0.1-2.0",
"(R package version 0.1-3.0",
"URL https://github.com/CenterForAssessment/SGPmatrices/")
)
4 changes: 2 additions & 2 deletions man/SGPmatrices-package.Rd
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
\tabular{ll}{
Package: \tab SGPmatrices\cr
Type: \tab Package\cr
Version: \tab 0.1-2.0\cr
Date: \tab 2025-4-21\cr
Version: \tab 0.1-3.0\cr
Date: \tab 2025-12-23\cr
License: \tab GPL-3\cr
LazyLoad: \tab Yes\cr
LazyData: \tab Yes\cr
Expand Down
7 changes: 6 additions & 1 deletion man/addBaselineMatrices.Rd
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ The function addBaselineMatrices adds baseline matrices contained in the SGPmatr
addBaselineMatrices(
state,
year,
add.matrices.to.which.state=NULL)
add.matrices.to.which.state=NULL,
SGPt = FALSE)
}

\arguments{
Expand All @@ -19,6 +20,10 @@ addBaselineMatrices(
}
\item{add.matrices.to.which.state}{A character string for the state/assessment abbreviation where the baseline matrices will be placed in SGPstateData. If not argument is supplied the default is to use the state/assessment abbreviation supplied via the argument \code{state}.
}
\item{SGPt}{A logical value indicating whether to add SGPt baseline matrices. If not argument is supplied the default is to use the value of \code{SGPt} embedded in the SGPstateData object.
If \code{SGPt} is \code{TRUE}, the function will add SGPt baseline matrices to the SGPstateData object.
If \code{SGPt} is \code{FALSE}, the function will add baseline matrices to the SGPstateData object.
}
}

\value{Returns SGPstateData with the matrices associated with argument \code{state} embedded in the position associated with the argument \code{add.matrices.to.state} (defaults to \code{state}).
Expand Down