SlideShare a Scribd company logo
MANAGING ASQ DATA
A guide for relief nursery administrative assistants
USINGTHE DATABASE
 ASQ data is stored in an Access database
 Open Access and select the database
 Open the ASQ table
 Go to External Data tab on the Ribbon
 Export Data as “ASQ.csv” into the working directory (see next slide)
USING AWORKING DIRECTORY
 Choose a fairly top-level directory in which to store “ASQ.csv”
 “Desktop” can be a good choice
 You will refer to this directory when you run the analysis in R.
 You will also store the R code file here.This file is provided along with this
presentation.
 It’s possible to run this analysis without storing the code file, but you will need to
cut and paste into an editor.That’s is also easy, and will be explained later in this
presentation.
WORKING DIRECTORY CONTENTS
 You should have the following files in your working directory before proceeding:
 “ASQ.csv” (you generate this from Access, as discussed earlier)
 “ASQ_Progress_Matrix.csv” (table of reference values for ASQ categories, provided
along with this presentation)
 “ASQEvaluation.R” (R code provided along with this presentation)
USING R
 R is very simple to use in cases like this where you just need to run some code.You
don’t need to know how to program, or how to do statistical analyses. Just run the
code and let it do it’s thing.
 Start the program “RStudio.”
 Load the program file into RStudio.You can do this in one of two ways:
 Use CTRL-O to open a file like you would withWord or Excel.Then navigate to the
working directory and select the R code file “ASQEvaluation.R”
 Cut and paste code directly from these slides or from the code file itself, which is
basically just a text file (with R magic written in!).You will first need to open a new code
window (i.e. “source file”) in RStudio by using CTRL-Shift-N.
SETTING WORKING DIRECTORY IN R
 In the command line in RStudio, enter
the command to the right.
 Replace the part that says
“yourname” with your name as it
appears on the network.
 Keep those quotation marks you see
in the parentheses (they are part of
the syntax).
 This assumes you used “Desktop” as
your working directory. Change if
necessary.
setwd(“C:/Users/yourname/Desktop”)
THE CODE
 The actual code consists of two functions: one which imports and “cleans” the
data, and another which sorts the data to produce the key figures required by
stakeholders such as PCL.
 The code is explained in the following slides, but it is not necessary to understand
it.You may wish to experiment with it if you understand programming concepts,
or if you wish to learn these concepts by messing around with the code and seeing
how the results change.
 If you intend to play with the code for learning purposes, just be sure to edit under
a new file name so the original remains intact. Remember to actually use the
original code for reporting.
READING DATA INTO R
 The code to the right reads the two
CSV files into R, and determines
the number of rows of data (i.e.
how many total ASQ records you
have).
 After running the code, you can
invoke “index” in the command line
if you just want to know how much
data you have.
progress <- read.csv("ASQ_Progress_Matrix.csv")
asq <- read.csv("ASQ.csv“)
index <- nrow(asq)
CALCULATE MARGINALVALUES
 Loops through the ASQs and
calculates the marginal values
(i.e. how far above or below
benchmark in each of 5
categories)
mycollection <- data.frame()
for (i in 1:index){
myasqtype <- asq[i,4]
mysample <- asq[i,c(5:9)]
mystandard <-progress[progress$ASQType == myasqtype, c(2:6)]
myscore <- mysample - mystandard
mycollection <- rbind(mycollection, myscore)
}
CREATINGTHE FINALTABLE
 Produces the final table upon
which we run the analytical
code.
 The table can be invoked in the
command line as “allmeas” if
you want to review the data.
allmeas <- cbind (asq[,5:9], mycollection) firstfour <- asq[,1:4]
allmeas[, seq(1,9,2)] <- asq[,5:9]
allmeas[, seq(2,10,2)] <- mycollection
allmeas <- cbind(firstfour, allmeas) colnames(allmeas)<-
c(colnames(allmeas[,1:4]),
c("COM","margCOM", "GROS", "margGROS",
"FINE", "margFINE", "PROB", "margPROB",
"PERS", "margPERS"))
WRITINGTHE FINALTABLETOWORKING
DIRECTORY
 This line of code writes the final table
to a csv file which you can open in
Excel.
 The file gets saved to your working
directory.
 The code makes this file
automatically once it is run.
write.csv(allmeas, "ASQ_final.csv")
ANALYTICAL FUNCTIONS
 The second part of the code is the
function “pclreport.”
 After the whole code file is sourced,
you will need to invoke this function
by typing the following into the
command line:
 pclreport()
 The results will print in the console.
 pclreport() consists of a number of
helper functions which work together
to answer questions posed in the PCL
report.
 These helper functions are explained
individually ahead.
IDENTIFYINGTHEVALID SUBSET
 Within any span of time under
consideration (fiscal year, fiscal quarter,
etc), PCL wants to assess students in
program 6 + months.
 This function identifies students with at
least 2 ASQs conducted, with the first
and last ASQ on record being at least 6
months apart.
valid <- function(student=""){
x <- subset(allmeas, StudentID==student)
if (nrow(x)==1) {
return (FALSE)
}
else if ((diff(x$ASQType)) >= 6){
return(TRUE)
} else{
return (FALSE)
}
}
IDENTIFYINGTHE SUBSET WITH DELAYS
 PCL assesses program effectiveness in
impacting developmental progress.
 This function identifies students from
the prior subset whose scores gave
indication of delays in at least one
category.
delay <- function (student=""){
x <- subset(allmeas, StudentID==student,
select=c(seq(6,14,2)))
xlogical <- x >= 0
if (FALSE %in% xlogical){
return(TRUE)
} else{
return (FALSE)
}
}
IDENTIFYINGTHE SUBSET OF SUCCESS
CASES
 This function identifies students
from the delays-indicated subset
whose scores on their last ASQ
indicated no delays present.
success <- function(student=""){
x <- subset(allmeas, StudentID==student,
select=c(2,3, seq(4, 14, 2)))
x$ASQDate <- as.Date(x$ASQDate,
"%m/%d/%Y")
lastASQ <- max(x$ASQDate)
data <- x[x$ASQDate==lastASQ, ]
obs <- data[4:8]
logicval <- -1 %in% sign(obs)
if (logicval == FALSE){
return(TRUE)
} else {
return(FALSE)
}
}
GENERIC SORTING CODE
 This function applies the other
functions within the larger function.
 It’s kind of like the circulation that
makes the other functions (muscles)
able to process data (oxygen, blood,
whatever) within the body of the larger
function.
getsubsets <- function(myvector=c(), myfunct=""){
a <- lapply(myvector, myfunct)
b <- which(a==TRUE)
c <- length(b)
d <- myvector[b]
return(d)
}
PUTTING IT ALLTOGETHER
 Generic sorting code is invoked to get
the data needed
 Display variables are created to store
the system responses
 System responds to user through the
print command at the end
 Results are written to a CSV file named
“ASQPCL.csv” in working directory
roster <- unique(allmeas$StudentID)
validIDs <- getsubsets(roster, valid)
delayedIDs <- getsubsets(validIDs, delay)
successfulIDs <- getsubsets(delayedIDs, success)
disprost <- paste("There are", length(roster), "students in the file who
have recieved ASQs.")
dispvalid <- paste ("Of these,", length(validIDs),
"students received a 6 month follow up.")
dispdelay <- paste(length(delayedIDs), "of these students were
identified as having delays in at least one ASQ.")
dispsuccess <- paste(length(successfulIDs), "students with delays were
found to have no delays after 6 months in program.")
paragraph <- paste(c(disprost, dispvalid,
dispdelay, dispsuccess))
print(paragraph)
write.csv(paragraph, “ASQPCL.csv”)
REVIEW
 Get the stuff into your working directory
 Set your working directory in RStudio to be the same one that has the R code and the CSV
files using setwd(“C:blahblahblah”)
 Open the R code file in RStudio
 Source the code into the working environment by pressing the “Source” button in the
upper right hand corner of the code window.
 Type “pclreport()”, all lowercase, without the quotation marks, into the R console.
 At this point, you will have answers on the screen and two new CSV files with the data
table and the results of the PCL function preserved. Remember that R will save over these
files every time you run this code, so if you want to preserve any files for records, move it
into another directory and rename them with an appropriately identifying name.

More Related Content

PDF
Stata tutorial
PDF
Introduction to STATA - Ali Rashed
PDF
Data management in Stata
PPTX
Database COMPLETE
PDF
How PROC SQL and SAS® Macro Programming Made My Statistical Analysis Easy? A ...
PPTX
MS SQL SERVER: Programming sql server data mining
PDF
Introduction to Stata
PDF
Stata tutorial university of princeton
Stata tutorial
Introduction to STATA - Ali Rashed
Data management in Stata
Database COMPLETE
How PROC SQL and SAS® Macro Programming Made My Statistical Analysis Easy? A ...
MS SQL SERVER: Programming sql server data mining
Introduction to Stata
Stata tutorial university of princeton

What's hot (20)

PPTX
Getting Started with MySQL I
PPSX
MS SQL Server
PPTX
Getting Started with MySQL II
ODP
Ms sql-server
PDF
MIS5101 WK10 Outcome Measures
PDF
Using T-SQL
PPT
Module02
PDF
PPT
Sql intro & ddl 1
PDF
Stata datman
PPTX
Introduction to database
PPTX
Database Systems - SQL - DCL Statements (Chapter 3/4)
PPTX
Query parameterization
PPTX
Difference Between Sql - MySql and Oracle
PDF
Database Architecture and Basic Concepts
PPTX
U-SQL Query Execution and Performance Tuning
PPTX
Sql commands
PDF
Introduction to sas
PPTX
Oracle basic queries
Getting Started with MySQL I
MS SQL Server
Getting Started with MySQL II
Ms sql-server
MIS5101 WK10 Outcome Measures
Using T-SQL
Module02
Sql intro & ddl 1
Stata datman
Introduction to database
Database Systems - SQL - DCL Statements (Chapter 3/4)
Query parameterization
Difference Between Sql - MySql and Oracle
Database Architecture and Basic Concepts
U-SQL Query Execution and Performance Tuning
Sql commands
Introduction to sas
Oracle basic queries
Ad

Similar to Managing ASQ Data: a Guide for Relief Nursery Administrative Assistants (20)

PPT
8323 Stats - Lesson 1 - 03 Introduction To Sas 2008
PPT
SAS Online Training by Real Time Working Professionals in USA,UK,India,Middle...
DOC
Introduction to sas
PPT
MMYERS Portfolio
PDF
Agile Data Science 2.0
PDF
Agile Data Science 2.0
DOCX
CIS 336 (DEVRY) Entire Course NEW
PDF
Agile Data Science 2.0
PPT
5116427.ppt
PDF
Agile Data Science 2.0: Using Spark with MongoDB
PPT
Hands on Mahout!
PDF
SQL Performance Tuning and New Features in Oracle 19c
PDF
Agile Data Science 2.0
PPT
Prog1 chap1 and chap 2
PPTX
Get started with R lang
PDF
Agile Data Science 2.0 - Big Data Science Meetup
PPTX
Aggregate.pptx
PDF
2014.06.24.what is ubix
PPTX
Machine Learning - Simple Linear Regression
PDF
Agile Data Science
8323 Stats - Lesson 1 - 03 Introduction To Sas 2008
SAS Online Training by Real Time Working Professionals in USA,UK,India,Middle...
Introduction to sas
MMYERS Portfolio
Agile Data Science 2.0
Agile Data Science 2.0
CIS 336 (DEVRY) Entire Course NEW
Agile Data Science 2.0
5116427.ppt
Agile Data Science 2.0: Using Spark with MongoDB
Hands on Mahout!
SQL Performance Tuning and New Features in Oracle 19c
Agile Data Science 2.0
Prog1 chap1 and chap 2
Get started with R lang
Agile Data Science 2.0 - Big Data Science Meetup
Aggregate.pptx
2014.06.24.what is ubix
Machine Learning - Simple Linear Regression
Agile Data Science
Ad

Recently uploaded (20)

PPTX
SUKANYA SAMRIDDHI YOJANA RESEARCH REPORT AIMS OBJECTIVES ITS PROVISION AND IM...
PPTX
Chapter 1: Philippines constitution laws
PPTX
True Fruits_ reportcccccccccccccccc.pptx
PPTX
DFARS Part 252 - Clauses - Defense Regulations
PPTX
Portland FPDR Oregon Legislature 2025.pptx
PPTX
Part II LGU Accreditation of CSOs and Selection of Reps to LSBs ver2.pptx
PDF
Population Estimates 2025 Regional Snapshot 08.11.25
PPTX
BHARATIYA NAGARIKA SURAKSHA SAHMITA^J2023 (1).pptx
PDF
PPT Items # 6&7 - 900 Cambridge Oval Right-of-Way
PPTX
Workshop-Session-1-LGU-WFP-Formulation.pptx
PDF
Item # 3 - 934 Patterson Final Review.pdf
PDF
eVerify Overview and Detailed Instructions to Set up an account
PDF
Creating Memorable Moments_ Personalized Plant Gifts.pdf
DOCX
EAPP.docxdffgythjyuikuuiluikluikiukuuuuuu
PPTX
Parliamentary procedure in meeting that can be use
PDF
PPT Item #s 2&3 - 934 Patterson SUP & Final Review
PPTX
Weekly Report 17-10-2024_cybersecutity.pptx
PPTX
Introduction_to_the_Study_of_Globalization.pptx
PDF
PPT - Primary Rules of Interpretation (1).pdf
PPTX
Neurons.pptx and the family in London are you chatgpt
SUKANYA SAMRIDDHI YOJANA RESEARCH REPORT AIMS OBJECTIVES ITS PROVISION AND IM...
Chapter 1: Philippines constitution laws
True Fruits_ reportcccccccccccccccc.pptx
DFARS Part 252 - Clauses - Defense Regulations
Portland FPDR Oregon Legislature 2025.pptx
Part II LGU Accreditation of CSOs and Selection of Reps to LSBs ver2.pptx
Population Estimates 2025 Regional Snapshot 08.11.25
BHARATIYA NAGARIKA SURAKSHA SAHMITA^J2023 (1).pptx
PPT Items # 6&7 - 900 Cambridge Oval Right-of-Way
Workshop-Session-1-LGU-WFP-Formulation.pptx
Item # 3 - 934 Patterson Final Review.pdf
eVerify Overview and Detailed Instructions to Set up an account
Creating Memorable Moments_ Personalized Plant Gifts.pdf
EAPP.docxdffgythjyuikuuiluikluikiukuuuuuu
Parliamentary procedure in meeting that can be use
PPT Item #s 2&3 - 934 Patterson SUP & Final Review
Weekly Report 17-10-2024_cybersecutity.pptx
Introduction_to_the_Study_of_Globalization.pptx
PPT - Primary Rules of Interpretation (1).pdf
Neurons.pptx and the family in London are you chatgpt

Managing ASQ Data: a Guide for Relief Nursery Administrative Assistants

  • 1. MANAGING ASQ DATA A guide for relief nursery administrative assistants
  • 2. USINGTHE DATABASE  ASQ data is stored in an Access database  Open Access and select the database  Open the ASQ table  Go to External Data tab on the Ribbon  Export Data as “ASQ.csv” into the working directory (see next slide)
  • 3. USING AWORKING DIRECTORY  Choose a fairly top-level directory in which to store “ASQ.csv”  “Desktop” can be a good choice  You will refer to this directory when you run the analysis in R.  You will also store the R code file here.This file is provided along with this presentation.  It’s possible to run this analysis without storing the code file, but you will need to cut and paste into an editor.That’s is also easy, and will be explained later in this presentation.
  • 4. WORKING DIRECTORY CONTENTS  You should have the following files in your working directory before proceeding:  “ASQ.csv” (you generate this from Access, as discussed earlier)  “ASQ_Progress_Matrix.csv” (table of reference values for ASQ categories, provided along with this presentation)  “ASQEvaluation.R” (R code provided along with this presentation)
  • 5. USING R  R is very simple to use in cases like this where you just need to run some code.You don’t need to know how to program, or how to do statistical analyses. Just run the code and let it do it’s thing.  Start the program “RStudio.”  Load the program file into RStudio.You can do this in one of two ways:  Use CTRL-O to open a file like you would withWord or Excel.Then navigate to the working directory and select the R code file “ASQEvaluation.R”  Cut and paste code directly from these slides or from the code file itself, which is basically just a text file (with R magic written in!).You will first need to open a new code window (i.e. “source file”) in RStudio by using CTRL-Shift-N.
  • 6. SETTING WORKING DIRECTORY IN R  In the command line in RStudio, enter the command to the right.  Replace the part that says “yourname” with your name as it appears on the network.  Keep those quotation marks you see in the parentheses (they are part of the syntax).  This assumes you used “Desktop” as your working directory. Change if necessary. setwd(“C:/Users/yourname/Desktop”)
  • 7. THE CODE  The actual code consists of two functions: one which imports and “cleans” the data, and another which sorts the data to produce the key figures required by stakeholders such as PCL.  The code is explained in the following slides, but it is not necessary to understand it.You may wish to experiment with it if you understand programming concepts, or if you wish to learn these concepts by messing around with the code and seeing how the results change.  If you intend to play with the code for learning purposes, just be sure to edit under a new file name so the original remains intact. Remember to actually use the original code for reporting.
  • 8. READING DATA INTO R  The code to the right reads the two CSV files into R, and determines the number of rows of data (i.e. how many total ASQ records you have).  After running the code, you can invoke “index” in the command line if you just want to know how much data you have. progress <- read.csv("ASQ_Progress_Matrix.csv") asq <- read.csv("ASQ.csv“) index <- nrow(asq)
  • 9. CALCULATE MARGINALVALUES  Loops through the ASQs and calculates the marginal values (i.e. how far above or below benchmark in each of 5 categories) mycollection <- data.frame() for (i in 1:index){ myasqtype <- asq[i,4] mysample <- asq[i,c(5:9)] mystandard <-progress[progress$ASQType == myasqtype, c(2:6)] myscore <- mysample - mystandard mycollection <- rbind(mycollection, myscore) }
  • 10. CREATINGTHE FINALTABLE  Produces the final table upon which we run the analytical code.  The table can be invoked in the command line as “allmeas” if you want to review the data. allmeas <- cbind (asq[,5:9], mycollection) firstfour <- asq[,1:4] allmeas[, seq(1,9,2)] <- asq[,5:9] allmeas[, seq(2,10,2)] <- mycollection allmeas <- cbind(firstfour, allmeas) colnames(allmeas)<- c(colnames(allmeas[,1:4]), c("COM","margCOM", "GROS", "margGROS", "FINE", "margFINE", "PROB", "margPROB", "PERS", "margPERS"))
  • 11. WRITINGTHE FINALTABLETOWORKING DIRECTORY  This line of code writes the final table to a csv file which you can open in Excel.  The file gets saved to your working directory.  The code makes this file automatically once it is run. write.csv(allmeas, "ASQ_final.csv")
  • 12. ANALYTICAL FUNCTIONS  The second part of the code is the function “pclreport.”  After the whole code file is sourced, you will need to invoke this function by typing the following into the command line:  pclreport()  The results will print in the console.  pclreport() consists of a number of helper functions which work together to answer questions posed in the PCL report.  These helper functions are explained individually ahead.
  • 13. IDENTIFYINGTHEVALID SUBSET  Within any span of time under consideration (fiscal year, fiscal quarter, etc), PCL wants to assess students in program 6 + months.  This function identifies students with at least 2 ASQs conducted, with the first and last ASQ on record being at least 6 months apart. valid <- function(student=""){ x <- subset(allmeas, StudentID==student) if (nrow(x)==1) { return (FALSE) } else if ((diff(x$ASQType)) >= 6){ return(TRUE) } else{ return (FALSE) } }
  • 14. IDENTIFYINGTHE SUBSET WITH DELAYS  PCL assesses program effectiveness in impacting developmental progress.  This function identifies students from the prior subset whose scores gave indication of delays in at least one category. delay <- function (student=""){ x <- subset(allmeas, StudentID==student, select=c(seq(6,14,2))) xlogical <- x >= 0 if (FALSE %in% xlogical){ return(TRUE) } else{ return (FALSE) } }
  • 15. IDENTIFYINGTHE SUBSET OF SUCCESS CASES  This function identifies students from the delays-indicated subset whose scores on their last ASQ indicated no delays present. success <- function(student=""){ x <- subset(allmeas, StudentID==student, select=c(2,3, seq(4, 14, 2))) x$ASQDate <- as.Date(x$ASQDate, "%m/%d/%Y") lastASQ <- max(x$ASQDate) data <- x[x$ASQDate==lastASQ, ] obs <- data[4:8] logicval <- -1 %in% sign(obs) if (logicval == FALSE){ return(TRUE) } else { return(FALSE) } }
  • 16. GENERIC SORTING CODE  This function applies the other functions within the larger function.  It’s kind of like the circulation that makes the other functions (muscles) able to process data (oxygen, blood, whatever) within the body of the larger function. getsubsets <- function(myvector=c(), myfunct=""){ a <- lapply(myvector, myfunct) b <- which(a==TRUE) c <- length(b) d <- myvector[b] return(d) }
  • 17. PUTTING IT ALLTOGETHER  Generic sorting code is invoked to get the data needed  Display variables are created to store the system responses  System responds to user through the print command at the end  Results are written to a CSV file named “ASQPCL.csv” in working directory roster <- unique(allmeas$StudentID) validIDs <- getsubsets(roster, valid) delayedIDs <- getsubsets(validIDs, delay) successfulIDs <- getsubsets(delayedIDs, success) disprost <- paste("There are", length(roster), "students in the file who have recieved ASQs.") dispvalid <- paste ("Of these,", length(validIDs), "students received a 6 month follow up.") dispdelay <- paste(length(delayedIDs), "of these students were identified as having delays in at least one ASQ.") dispsuccess <- paste(length(successfulIDs), "students with delays were found to have no delays after 6 months in program.") paragraph <- paste(c(disprost, dispvalid, dispdelay, dispsuccess)) print(paragraph) write.csv(paragraph, “ASQPCL.csv”)
  • 18. REVIEW  Get the stuff into your working directory  Set your working directory in RStudio to be the same one that has the R code and the CSV files using setwd(“C:blahblahblah”)  Open the R code file in RStudio  Source the code into the working environment by pressing the “Source” button in the upper right hand corner of the code window.  Type “pclreport()”, all lowercase, without the quotation marks, into the R console.  At this point, you will have answers on the screen and two new CSV files with the data table and the results of the PCL function preserved. Remember that R will save over these files every time you run this code, so if you want to preserve any files for records, move it into another directory and rename them with an appropriately identifying name.