3.15. Script 15: Primary Education Tracking

This code produces default parameters for primary education grade tracking. For a given education fate (enter school, graduation) the parameters define when education is entered, grade success and repetition.

3.15.1. File output

The code below generates model parameters stored in a Modgen .dat file. The parameters are not based on data but just produce intuitive place-holders.

  • The start of the school year
  • The end of the school year
  • Grade repetiotion rate
  • Career interruption rate (one year out of school)
  • Distribution of entry ages

3.15.2. Code

3.15.2.1. School Entry

####################################################################################################
# 
#  DYNAMIS-POP Parameter Generation File 15 Primary Education Grade Tracking
#  This file is generic and works for all country contexts. 
#  Input file: globals_for_analysis.RData (To generate such a file run the setup script)
#  Last Update: Martin Spielauer 2018-06-29
#
####################################################################################################

####################################################################################################
# Clear work space, load required packages and the input object file
####################################################################################################

rm(list=ls())

library(haven)
library(dplyr)
library(data.table)
library(sp) 
library(maptools)
library(survival)
library(fmsb)
library(eha)

load(file="globals_for_analysis.RData")
parafile        <- file(g_para_primaryeductrack, "w") # Output Parameter File


cat("parameters  {\n", file=parafile)

cat("   double	StartSchoolOneYear = ",g_school_season_start,"; //EN Start at school season\n", file=parafile, append=TRUE)
cat("   double	EndSchoolOneYear  = ",g_school_season_end,"; //EN End of school season\n", file=parafile, append=TRUE)
cat("	 //EN Grade repetition rate\n	double	SchoolOneRepetitionRate[EDUC_ONE_GEO][EDUC_ONE_GROUP][SIM_YEAR_RANGE] = {	(101) 0.1, };\n", file=parafile, append=TRUE)
cat("	 //EN School interruption rate\n double	SchoolOneInterruptionRate[EDUC_ONE_GEO][EDUC_ONE_GROUP][SIM_YEAR_RANGE] = {	(101) 0.1, 	};\n", file=parafile, append=TRUE)
cat("	 //EN Distribution entry age\n cumrate	EducOneEntryAge[EDUC_ONE_GEO][EDUC_ONE_GROUP][YOB_GRAD_PRIMARY][EDUC_ONE_ENTRY_AGE] = {	(67) {	0.05, 0.85, (2) 0.05, 	},	};\n", file=parafile, append=TRUE)
cat("	 //EN Distribution dropout grade \n cumrate	EducOneDropoutGrade[EDUC_ONE_GEO][EDUC_ONE_GROUP][YOB_GRAD_PRIMARY][EDUC_ONE_GRADE] = {	(67) {	4, 5, (4) 1, 	},	};\n", file=parafile, append=TRUE)

# end and close parameter output writing
cat("\n\n};", file=parafile, append=TRUE) 
close(parafile)