MICS Data Processing Workshop User-Defined and Built-In Functions.

Slides:



Advertisements
Similar presentations
Updated: 12/31/2013 Understanding and Setting up Workers Compensation.
Advertisements

Lists, Loops, Validation, and More
Copyright © 2007 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Slide 5- 1 STARTING OUT WITH Visual Basic 2008 FOURTH EDITION Tony Gaddis.
Review of Data Processing Steps MICS3 Data Analysis and Report Writing Workshop.
MICS4 Data Processing Workshop Multiple Indicator Cluster Surveys Data Processing Workshop Data Entry Editing.
MICS Data Processing Workshop Supervisors Menu. Purpose of the Supervisors Menu Executes supervisors applications –...and displays results Transfers and.
MICS DATA PROCESSING Data Entry Editing. REMEMBER AND REMIND YOUR FIELD STAFF: The best place to correct data is in the field where the respondent is.
MICS4 Data Processing Workshop Multiple Indicator Cluster Surveys Data Processing Workshop Built-In and User-Defined Functions.
MICS4 Data Processing Workshop Multiple Indicator Cluster Surveys Data Processing Workshop Data Entry Applications with Logic.
MICS Data Processing Workshop Recoding in SPSS. Secondary Data Processing Flow Export Data from CSPRO Import Data into SPSS Recode Variables Add Sample.
MICS Data Processing Workshop
MICS Data Processing Workshop
MICS Data Processing Workshop The Data Dictionary and Forms.
MICS DATA PROCESSING Secondary Editing. REMEMBER AND REMIND YOUR FIELD STAFF: The best place to correct data is in the field where the respondent is available.
MICS Data Processing Workshop Data Entry Application.
MICS4 Data Processing Workshop Multiple Indicator Cluster Surveys Data Processing Workshop MICS Dictionary and Forms.
MICS4 Data Processing Workshop Multiple Indicator Cluster Surveys Data Processing Workshop Secondary Editing.
October 2008 MPDPF and MOC Enhancements – Consolidated Mockups.
Michigan Electronic Grants System Plus
SADC Course in Statistics Estimating population characteristics with simple random sampling (Session 06)
1 Reverse a Journal Find an existing journal and reverse it in either: A original period B a different period.
DT266/2 Information Systems COBOL Revision. Chapters 1 & 2 Hutty & Spence Divisions of a Cobol Program Identification Division Program-ID. Environment.
To Halton Youth Service 
Question Bank. Explain the syntax of if else statement? Define Union Define global and local variables with example Concept of recursion with example.
Access Lesson 13 Programming in Access Microsoft Office 2010 Advanced Cable / Morrison 1.
1 After completing this lesson, you will be able to: Check spelling in a document. Check for grammatical errors. Find specific text. Replace specific text.
Multiple Indicator Cluster Surveys Data Processing Workshop Data Entry Applications with Logic MICS Data Processing Workshop.
© Copyright by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved. 1 Tutorial 12 – Security Panel Application Introducing.
Business Planning using Spreasheets-2 1 BP-2: Good Spreadsheet Practice  There is always the temptation to rush in and start entering data.  However.
Student Plans v Enhancements & Corrections! Broadcast messages to users MA Billing enhancements New options with Student Summary Internal link.
General Ledger Fiscal Year End Closing out WELCOME! To the Year End Workshop. During this workshop and presentation, references will be made to.
Decisions If statements in C.
Chapter 13 – Introduction to Classes
© Copyright 1992–2005 by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved. Tutorial 13 – Salary Survey Application: Introducing.
Lecture 14 User-defined functions Function: concept, syntax, and examples © 2007 Daniel Valentine. All rights reserved. Published by Elsevier.
1 Programming Languages (CS 550) Mini Language Interpreter Jeremy R. Johnson.
Benchmark Series Microsoft Excel 2013 Level 2
Making Choices in C if/else statement logical operators break and continue statements switch statement the conditional operator.
Learning Objectives Copyright © 2002 South-Western/Thomson Learning Data Processing and Fundamental Data Analysis CHAPTER fourteen.
Chapter 11: Classes and Objects
The IDE (Integrated Development Environment) provides a DEBUGGER for locating and correcting errors in program logic (logic errors not syntax errors) The.
MICS Data Processing Workshop Multiple Indicator Cluster Surveys Data Processing Workshop Data Quality Tables.
Lesson 4 Cell Reference Formulas. Working with Cell References continued… Relative Cell Reference A relative cell reference means that the cell value.
© 1999, by Que Education and Training, Chapter 5, pages of Introduction to Computer Programming with Visual Basic 6: A Problem-Solving Approach.
9/18/2015Slide 1 The homework problems on comparing central tendency and variability extend the focus central tendency and variability to a comparison.
Microsoft Visual Basic 2008 CHAPTER ELEVEN Multiple Classes and Inheritance.
Multiple Indicator Cluster Surveys Data Processing Workshop Secondary Editing MICS Data Processing Workshop.
Lesson NUMERIC-FIELDPIC 9(5). 05 ALPHANUMERIC-FIELDPIC X(5).... IF NUMERIC-FIELD = 10...(valid entry) IF NUMERIC-FIELD = ‘10’... (invalid entry)
Chapter 5: More on the Selection Structure Programming with Microsoft Visual Basic 2005, Third Edition.
Creating Graphical User Interfaces (GUI’s) with MATLAB By Jeffrey A. Webb OSU Gateway Coalition Member.
VALIDATION CONTROLS.  Validation Controls are primarily used to validate, or verify the data entered by user into a web form.  Validation controls attempt.
Programming with Microsoft Visual Basic th Edition
11- 1 Chapter 11.  Avoiding Logic Errors by Validating Input  What to Do If Input Errors Occur  Global Considerations in COBOL  When Data Should Be.
Practical Programming COMP153-08S Week 5 Lecture 1: Screen Design Subroutines and Functions.
Chapter 11 Data Validation. Question Should your program assume the data is correct, or should your program edit the data to ensure it is correct?
Multiple Indicator Cluster Surveys Data Processing Workshop Built-In and User-Defined Functions MICS Data Processing Workshop.
11- 1 Chapter 11.  Avoiding Logic Errors by Validating Input  What to Do If Input Errors Occur  Global Considerations in COBOL  When Data Should Be.
Programming. Exam Validation 1-10 Technical words such as Method of validation Do not use “Something”.
Multiple Indicator Cluster Surveys Data Processing Workshop Overview of SPSS structural check programs and frequencies MICS Data Processing Workshop.
Chapter Five More on the Selection Structure Programming with Microsoft Visual Basic th Edition.
An Introduction to Programming with C++ Sixth Edition Chapter 5 The Selection Structure.
Programming Logic and Design Fourth Edition, Comprehensive Chapter 10 Using Menus and Validating Input.
P2 Unit 42 : Spreadsheet Modelling. Task Use spreadsheet formulae and functions to calculate (read through section P3 for more information on formulae.
Standard Operating Procedure
The Selection Structure
Working with Formulas and Functions
[DISCLAIMER] This presentation document has been prepared by Vault Intelligence Limited (“Vault") and is intended for off line demonstration, presentation.
Boolean Expressions to Make Comparisons
Part 6 Q26 to Q30 of National 5 Prelim
Special Registers, Date functions, Case and User Defined Functions!!
Presentation transcript:

MICS Data Processing Workshop User-Defined and Built-In Functions

Built-In Functions CSPro has a wide range of built-in functions Not possible to modify Most built-in functions are well-documented in the help system – But we'll discuss a few that are not

Century Month Code January 1900 = CMC 1 December 1900 = CMC 12 January 1901 = CMC 13 April 2000 = CMC 1204 April 2001 = CMC 1216 CMC = (Year-1900)*12 + Month

The cmcode Function Purpose: calculate the CMC of a month/year Syntax: cmcode(month,year) Returns: – if month and year valid: CMC of month/year – if month or year invalid: 9999

The setlb Function Purpose: calculate the lower CMC bound for an event Syntax: setlb(month,year,minimum) Returns: – if month and year valid: CMC of month/year – if only year valid: CMC of 1/year – if year invalid: minimum

The setub Function Purpose: calculate the upper CMC bound for an event Syntax: setub(month,year,maximum) Returns: – if month and year valid: CMC of month/year – if only year valid: CMC of 12/year – if year invalid: maximum

Example of setlb and setub Suppose – WM8M = 98 – WM8Y = 1957 Using setlb and setub set – ldob = setlb(WM8M,WM8Y,0) = 685 – udob = setub(WM8M,WM8Y,9999) = 696

The adjlba Function Purpose: adjust lower CMC bound for an event using an age Syntax: adjlba(lcmc,ucmc,di,di,age) Arguments: – lcmc is lower bound of event – ucmc is upper bound of event – di is date of interview Denote resulting lower bound rlb

The adjlba Function Returns: – if rlb >= lcmc and rlb <= ucmc : rlb – if rlb < lcmc : lcmc – if rlb > ucmc : -1 Calculates: – rlb = di - age* – i.e., calculate minimum date of birth

The adjuba Function Purpose: adjust upper CMC bound for an event using an age Syntax: adjuba(lcmc,ucmc,di,di,age) Arguments: – lcmc is lower bound of event – ucmc is upper bound of event – di is date of interview Denote resulting lower bound rub

The adjuba Function Returns: – if rub >= lcmc and rub <= ucmc : rub – if rub > ucmc : ucmc – if rub < lcmc : -1 Calculates: – rub = di - age*12 – i.e., calculate maximum date of birth

Example of adjlba and adjuba Suppose – DOI is 06/2005 so di = 1266 – WM8M = 98, WM8Y = 1957 and WM9 = 48 – Thus ldob = 685 and udob = 696 rlb = 679 and rub = 690 Using setlb and setub set – t = adjlba(ldob,udob,di,di,wm9) = 685 – t = adjuba(ldob,udob,di,di,wm9) = 690

Using adjlba and adjuba t = adjlba(ldob,udob,diwm,diwm,WM9); if t < 0 then errmsg(1003); else ldob = t endif;

User-Defined Functions User-defined functions (UDF) can be created in the global procedure There are 14 UDF in the data entry application These functions do not need to be modified But they do need to be understood

Anthropometry UDF The first 7 UDF primarily concern anthropometry Six of these UDF concern only anthropometry and will not be discuss further The seventh is named agemth It calculates a childs age in months

The agemth UDF Syntax: agemth(bd,bm,by,md,mm,my) Returns: – childs age in months if birth day, month and year are valid – childs age in months using 15 as day if only birth month and year are valid – special if only birth year is valid Purpose: calculates most accurate age in months possible (used for anthropometry)

The valid UDF Syntax: valid( xvar ) Returns: – 1 if value of xvar is not special and less than 96 – 0 otherwise Purpose: checking that a variable has a valid value

The NAtoZero UDF Syntax: NAtoZero(xvar) Returns: – 0 if value of xvar is not applicable – value of xvar otherwise Purpose: permits one to use variables that may be not applicable in summations

The vdvalid UDF Syntax: vdvalid(vday,vmonth,vyear) Returns: – 0 if vaccination date is valid – 1 otherwise Purpose: checking that a vaccination date is valid

The vdoi UDF Syntax: vdoi(vday,vmonth,vyear) Returns: – 0 if vaccination date is before date of interview – 1 otherwise Purpose: checking the vaccination is not after the date of interview

The vdob UDF Syntax: vdob(vday,vmonth,vyear) Returns: – 0 if vaccination date is before a childs date of birth – 1 otherwise Purpose: checks vaccination date is after date of birth

The vseq UDF (Editing Only!) Syntax: vseq(v1d,v1m,v1y,v2d,v2m,v2y) Returns: – 0 if vaccination one was given before vaccination 2 – 1 otherwise Purpose: checks that sequential vaccinations (e.g., polio) are in the correct order

The vmatch UDF (Editing Only!) Syntax: vmatch(v1d,v1m,v1y,v2d,v2m,v2y) Returns: – 0 if vaccinations given on the same date – 1 otherwise Purpose: check if vaccinations often given on the same date (e.g., polio and DPT) were given on the same date

The endmess UDF Syntax: endmess() Action: in add mode displays options – 1 Review Questionnaire – 2 Next Questionnaire Returns: – 1 if data entry operator selects review questionnaire option from menu – 0 otherwise

The alphachk UDF Syntax: alphachk(alphamask) Requirement: precede with assignment statement – alphavar = $ Input: acceptable values for an alphanumeric variable – e.g., for WS6 alphamask is ABCDEFXZ

The alphachk UDF Actions: – checks responses in alphavar are in alphamask – checks responses in alphavar are in alphabetical order – checks that if ? is in alphavar then it is the only response in alphavar – places each response in alphavar in the location defined by its subitem e.g., for WS6, ACEF becomes A C EF