Stata tip: generation of string matrices using local macros

Size: px
Start display at page:

Download "Stata tip: generation of string matrices using local macros"

Transcription

1 Stata tip: generation of string matrices using local macros Dmytro Vikhrov Moody s Analytics Prague, Czech Republic Dmytro.Vikhrov@moodys.com Olga Loiseau-Aslanidi Moody s Analytics Prague, Czech Republic Olga.Loiseau-Aslanidi@moodys.com Mimeo August 12, 2016 Abstract. Unlike Mata, Stata does not allow users to create matrices containing string values. We recommend that practitioners store each row of a string matrix in a separate local. For a given row, columns are added to the local recursively, separated by a space. All the locals created are indexed by a sequential identifier which allows users to manage and organize them in memory efficiently. We show the application of this approach using variable selection in regression analysis. Keywords: matrix, string value, local macro, subset selection, binary code 1 Introduction It is practical to organize workflow using structured data arrays and it is common to have string values in such arrays. For example, criteria-based variable selection in regression analysis can be formalized as follows. First, all the permutations (subsets) of the vector of variables are generated and each subset is placed in a separate row of the array. Second, a best model is found by looping over the rows of the array and comparing the values of pre-defined criteria for each model. When coding these steps in Stata, users find that Stata does not allow string values in matrices. Harrison [2006] acknowledges this issue and suggests an algorithm that relies on the listing of the string characteristics of variables. Cox and Newton [2014] provide a detailed description of indispensable tools for dealing with lists and macros. The list is complemented by various posts in the Stata blog. However, there is no unique solution and this creates demand for algorithms that can supplement existing tools in various applications that include string matrices. One way to overcome the issue is to use Mata. However, an alternative and probably more time-efficient solution for users not familiar with Mata is to reformulate the task into a two-step procedure that relies on local macros. In step one, a matrix of strings 1 is split into rows and each row is represented by 1 A typical string matrix usually contains variable names, values or labels. 1

2 a local macro with an ID. In step two, each local is populated sequentially with respective column values. 2 How it works: simple example Suppose a researcher considers two potential models; model one with variables x 1,..., x 5 and model two with variables y 1,..., y 5. Table 1: Two models organized in an array containing string values. Name Variables model x x 1 x 2 x 3 x 4 x 5 model y y 1 y 2 y 3 y 4 y 5 Table 1 can be stored in Stata using the two-step procedure described above. In step one, we generate two local macros, namely model x and model y. Since there are two rows, we should create two local macros. In step two, each macro is populated with the column values from the respective rows. forvalues c = 1(1)5 { local model `r' `model `r'' `r'`c' macro list model `r' This code produces two local macros, namely model x that contains elements "x1 x2 x3 x4 x5" and model y with "y1 y2 y3 y4 y5". The macros are populated sequentially; at each iteration an additional column of Table 1 is added to the local (see the output below for model x). x1 x1 x2 x1 x2 x3 x1 x2 x3 x4 x1 x2 x3 x4 x5 Now, the locals can be used in a regression of a dependent variable lhs var on the independent variables contained in model x and model y using the code below. reg lhs var `model `r'' 2

3 3 Example with variable labels Special attention is required when string values contain spaces or special characters. For example, when working with variable labels, a space is no longer a valid separator of the elements within a macro (see Table 2). Hence compound double quotes should be used; see [U] Double quotes for more details. 2 Table 2: Two models containing variable labels organized in an array. Name Variable Labels labels of model x lab of x 1 lab of x 2 lab of x 3 labels of model y lab of y 1 lab of y 2 lab of y 3 To check if Stata understands you, count the number of elements in the locals using the list sizeof function from the extended macro functions. forvalues c = 1(1)3 { local lab model `r' `" `lab model `r'' `"lab of x`c'"' "' local size `r': list sizeof lab model `r' macro list lab model `r' size `r' The code above produces four lines of output: lab `"lab of x1"' `"lab of x2"' `"lab of x3"' size x: 3 lab model y: `"lab of x1"' `"lab of x2"' `"lab of x3"' size y: 3 The locals lab model x and lab model y can be used in labelling graphs (for example, see Cox 2011) or any other analysis performed on the labels of variables. The advantage of using local macros for programming sting matrices is that a user no longer works with an array of strings as a whole but with each row. Thus, most functions of local macros documented in [P] macrolists and [P] macro can be applied to individual rows. We recommend that users create macros on the extensive margin (i.e. more macros of relatively small size) rather than the intensive margin (i.e. a few macros, each containing many elements). Stata places stricter restrictions on the number of elements within a local than on the number of locals. See [R] limits for information on various Stata restrictions. 2 Cox [2011] provides more examples of counting elements of different types within a local. 3

4 4 Variable selection for regression Suppose we wish to find a model with such a combination of variables that ranks best on a pre-defined selection criterion, for example in-sample fit. For simplicity, assume that the vector of variables consists of x 1, x 2, x 3. The total number of potential models (subsets) created from this vector is 7 (=2 3 1) excluding an empty set (regression on a constant). These models are depicted in Table 3 below. We generate the models using binary count system as suggested by Miller [2002] on p. 23. Table 3: All potential models from the vector of three variables. Model ID Regressors Binary Representation 1 x x x 3 x x x 1 x x 1 x x 1 x 2 x Binary code 001 means that in model 1 regressor x 1 and x 2 are omitted, and the model consists of only one regressor x 3. In line with this reasoning, 111 refers to a model containing all the three regressors. When programming the subset selection in Stata, it is convenient to place each model into a local and use an incremental counter to order the models. Then, the models produced can be used in regression analysis. The code below illustrates this idea. set obs 100 // < Simulate data for regression g y = rnormal() forvalues i = 1(1)3 { qui g x`i'= rnormal() qui ds y, not // < Create a list of locals with models local initial vector `r(varlist)' forvalues i = 1(1)`=2^3-1' { // < Generate binary representation qui inbase 2 `i' local model = "`r(base)'" local size = length("`model'") forvalues j = 1(1)`size' { // < Match the binary to the variables local element = substr("`model'", `j', 1) if `element'== 1 { local model`i' `model`i'' `: word `= `size'- `j'+ 1' of `initial vector'' 4

5 macro list model`i' // < Show the models and estimate regressions reg lhs var `model`i'' When the number of potential regressors is relatively large, it makes sense to select models that have at most p regressors, where p is smaller than the vector of potential regressors. In this case the above code can be easily expanded to include another if loop. 5 Conclusion In this note, we describe how constructing a matrix of strings in Stata can be easily reformulated to work with local macros. Every row of the matrix is placed in an array of indexed local macros. A researcher can work with the macros separately or as an ordered group. An advantage of this approach is that it allows extra flexibility by applying the functionality of local macros to every row of the string matrix. We showed the application of this approach using subset selection procedure which is applicable in many areas of applied econometrics. 6 References Cox, N. J Stata tip 98: Counting substrings within strings. Stata Journal 11(2): Cox, N. J., and H. J. Newton, ed One Hundred Nineteen Stata Tips. 3rd ed. Stata Press. Harrison, D. A Stata tip 34: Tabulation by listing. Stata Journal 6(3): Miller, A. J Subset Selection in Regression. 2nd ed. New York: Chapman & Hall. 5

Economists. Melissa Dell Matt Notowidigdo Paul Schrimpf

Economists. Melissa Dell Matt Notowidigdo Paul Schrimpf 14.170: 170: Programming for Economists 1/12/2009-1/16/2009 Melissa Dell Matt Notowidigdo Paul Schrimpf Lecture 5, Large Data Sets in Stata + Numerical Precision Overview This lecture is part wrap-up p

More information

Introduction to Programming in C Department of Computer Science and Engineering. Lecture No. #16 Loops: Matrix Using Nested for Loop

Introduction to Programming in C Department of Computer Science and Engineering. Lecture No. #16 Loops: Matrix Using Nested for Loop Introduction to Programming in C Department of Computer Science and Engineering Lecture No. #16 Loops: Matrix Using Nested for Loop In this section, we will use the, for loop to code of the matrix problem.

More information

Lecture 2 Arrays, Searching and Sorting (Arrays, multi-dimensional Arrays)

Lecture 2 Arrays, Searching and Sorting (Arrays, multi-dimensional Arrays) Lecture 2 Arrays, Searching and Sorting (Arrays, multi-dimensional Arrays) In this lecture, you will: Learn about arrays Explore how to declare and manipulate data into arrays Understand the meaning of

More information

Multiresponse Sparse Regression with Application to Multidimensional Scaling

Multiresponse Sparse Regression with Application to Multidimensional Scaling Multiresponse Sparse Regression with Application to Multidimensional Scaling Timo Similä and Jarkko Tikka Helsinki University of Technology, Laboratory of Computer and Information Science P.O. Box 54,

More information

Stat 579: Objects in R Vectors

Stat 579: Objects in R Vectors Stat 579: Objects in R Vectors Ranjan Maitra 2220 Snedecor Hall Department of Statistics Iowa State University. Phone: 515-294-7757 maitra@iastate.edu, 1/23 Logical Vectors I R allows manipulation of logical

More information

6 Subscripting. 6.1 Basics of Subscripting. 6.2 Numeric Subscripts. 6.3 Character Subscripts

6 Subscripting. 6.1 Basics of Subscripting. 6.2 Numeric Subscripts. 6.3 Character Subscripts 6 Subscripting 6.1 Basics of Subscripting For objects that contain more than one element (vectors, matrices, arrays, data frames, and lists), subscripting is used to access some or all of those elements.

More information

Stata Session 2. Tarjei Havnes. University of Oslo. Statistics Norway. ECON 4136, UiO, 2012

Stata Session 2. Tarjei Havnes. University of Oslo. Statistics Norway. ECON 4136, UiO, 2012 Stata Session 2 Tarjei Havnes 1 ESOP and Department of Economics University of Oslo 2 Research department Statistics Norway ECON 4136, UiO, 2012 Tarjei Havnes (University of Oslo) Stata Session 2 ECON

More information

Directed Graph for Finite-State Machine

Directed Graph for Finite-State Machine Directed Graph for Finite-State Machine Tito D. Kesumo Siregar (13511018) 1 Program Studi Teknik Informatika Sekolah Teknik Elektro dan Informatika Institut Teknologi Bandung, Jl. Ganesha 10 Bandung 40132,

More information

Speaking Stata: Finding variables

Speaking Stata: Finding variables The Stata Journal (2010) 10, Number 2, pp. 281 296 Speaking Stata: Finding variables Nicholas J. Cox Department of Geography Durham University Durham City, UK n.j.cox@durham.ac.uk Abstract. A standard

More information

Memory General R0 Registers R1 R2. Input Register 1. Input Register 2. Program Counter. Instruction Register

Memory General R0 Registers R1 R2. Input Register 1. Input Register 2. Program Counter. Instruction Register CPU Organisation Central Processing Unit (CPU) Memory General R0 Registers R1 R2 ALU R3 Output Register Input Register 1 Input Register 2 Internal Bus Address Bus Data Bus Addr. $ 000 001 002 Program Counter

More information

Object Oriented Finite Element Modeling

Object Oriented Finite Element Modeling Object Oriented Finite Element Modeling Bořek Patzák Czech Technical University Faculty of Civil Engineering Department of Structural Mechanics Thákurova 7, 166 29 Prague, Czech Republic January 2, 2018

More information

Introduction to MATLAB

Introduction to MATLAB Introduction to MATLAB Introduction: MATLAB is a powerful high level scripting language that is optimized for mathematical analysis, simulation, and visualization. You can interactively solve problems

More information

EXTENDED ALGORITHM FOR DESIGN-MATRIX REORGANIZATION

EXTENDED ALGORITHM FOR DESIGN-MATRIX REORGANIZATION Proceedings of ICAD2011 ICAD-2011-03 EXTENDED ALGORITHM FOR DESIGN-MATRIX REORGANIZATION Efrén Moreno Benavides efren.moreno@upm.es Universidad Politécnica de Madrid Department of Aerospace Propulsion

More information

Further processing of estimation results: Basic programming with matrices

Further processing of estimation results: Basic programming with matrices The Stata Journal (2005) 5, Number 1, pp. 83 91 Further processing of estimation results: Basic programming with matrices Ian Watson ACIRRT, University of Sydney i.watson@econ.usyd.edu.au Abstract. Rather

More information

mcssubset: Efficient Computation of Best Subset Linear Regressions in R

mcssubset: Efficient Computation of Best Subset Linear Regressions in R mcssubset: Efficient Computation of Best Subset Linear Regressions in R Marc Hofmann Université de Neuchâtel Cristian Gatu Université de Neuchâtel Erricos J. Kontoghiorghes Birbeck College Achim Zeileis

More information

CSE 326: Data Structures Sorting Conclusion

CSE 326: Data Structures Sorting Conclusion CSE 36: Data Structures Sorting Conclusion James Fogarty Spring 009 Administrivia Homework Due Homework Assigned Better be working on Project 3 (code due May 7) Sorting Recap Selection Sort Bubble Sort

More information

Web page recommendation using a stochastic process model

Web page recommendation using a stochastic process model Data Mining VII: Data, Text and Web Mining and their Business Applications 233 Web page recommendation using a stochastic process model B. J. Park 1, W. Choi 1 & S. H. Noh 2 1 Computer Science Department,

More information

MODULE 6 Different Approaches to Feature Selection LESSON 10

MODULE 6 Different Approaches to Feature Selection LESSON 10 MODULE 6 Different Approaches to Feature Selection LESSON 10 Sequential Feature Selection Keywords: Forward, Backward, Sequential, Floating 1 Sequential Methods In these methods, features are either sequentially

More information

Question 7.11 Show how heapsort processes the input:

Question 7.11 Show how heapsort processes the input: Question 7.11 Show how heapsort processes the input: 142, 543, 123, 65, 453, 879, 572, 434, 111, 242, 811, 102. Solution. Step 1 Build the heap. 1.1 Place all the data into a complete binary tree in the

More information

Exploring Econometric Model Selection Using Sensitivity Analysis

Exploring Econometric Model Selection Using Sensitivity Analysis Exploring Econometric Model Selection Using Sensitivity Analysis William Becker Paolo Paruolo Andrea Saltelli Nice, 2 nd July 2013 Outline What is the problem we are addressing? Past approaches Hoover

More information

Flexible-Hybrid Sequential Floating Search in Statistical Feature Selection

Flexible-Hybrid Sequential Floating Search in Statistical Feature Selection Flexible-Hybrid Sequential Floating Search in Statistical Feature Selection Petr Somol 1,2, Jana Novovičová 1,2, and Pavel Pudil 2,1 1 Dept. of Pattern Recognition, Institute of Information Theory and

More information

Theory of control structures

Theory of control structures Theory of control structures Paper written by Bohm and Jacopini in 1966 proposed that all programs can be written using 3 types of control structures. Theory of control structures sequential structures

More information

Unix Computer To open MATLAB on a Unix computer, click on K-Menu >> Caedm Local Apps >> MATLAB.

Unix Computer To open MATLAB on a Unix computer, click on K-Menu >> Caedm Local Apps >> MATLAB. MATLAB Introduction This guide is intended to help you start, set up and understand the formatting of MATLAB before beginning to code. For a detailed guide to programming in MATLAB, read the MATLAB Tutorial

More information

DOWNLOAD PDF MICROSOFT EXCEL ALL FORMULAS LIST WITH EXAMPLES

DOWNLOAD PDF MICROSOFT EXCEL ALL FORMULAS LIST WITH EXAMPLES Chapter 1 : Examples of commonly used formulas - Office Support A collection of useful Excel formulas for sums and counts, dates and times, text manipularion, conditional formatting, percentages, Excel

More information

Tracking in image sequences

Tracking in image sequences CENTER FOR MACHINE PERCEPTION CZECH TECHNICAL UNIVERSITY Tracking in image sequences Lecture notes for the course Computer Vision Methods Tomáš Svoboda svobodat@fel.cvut.cz March 23, 2011 Lecture notes

More information

Sacha Kapoor - Masters Metrics

Sacha Kapoor - Masters Metrics Sacha Kapoor - Masters Metrics 091610 1 Address: Max Gluskin House, 150 St.George, Rm 329 Email: sacha.kapoor@utoronto.ca Web: http://individual.utoronto.ca/sacha$_$kapoor 1 Basics Here are some data resources

More information

Generating random samples from user-defined distributions

Generating random samples from user-defined distributions The Stata Journal (2011) 11, Number 2, pp. 299 304 Generating random samples from user-defined distributions Katarína Lukácsy Central European University Budapest, Hungary lukacsy katarina@phd.ceu.hu Abstract.

More information

Using Templates to Introduce Time Efficiency Analysis in an Algorithms Course

Using Templates to Introduce Time Efficiency Analysis in an Algorithms Course Using Templates to Introduce Time Efficiency Analysis in an Algorithms Course Irena Pevac Department of Computer Science Central Connecticut State University, New Britain, CT, USA Abstract: We propose

More information

CHAPTER 5 GENERATING TEST SCENARIOS AND TEST CASES FROM AN EVENT-FLOW MODEL

CHAPTER 5 GENERATING TEST SCENARIOS AND TEST CASES FROM AN EVENT-FLOW MODEL CHAPTER 5 GENERATING TEST SCENARIOS AND TEST CASES FROM AN EVENT-FLOW MODEL 5.1 INTRODUCTION The survey presented in Chapter 1 has shown that Model based testing approach for automatic generation of test

More information

6.001 Notes: Section 4.1

6.001 Notes: Section 4.1 6.001 Notes: Section 4.1 Slide 4.1.1 In this lecture, we are going to take a careful look at the kinds of procedures we can build. We will first go back to look very carefully at the substitution model,

More information

Stat 602X Exam 2 Spring 2011

Stat 602X Exam 2 Spring 2011 Stat 60X Exam Spring 0 I have neither given nor received unauthorized assistance on this exam. Name Signed Date Name Printed . Below is a small p classification training set (for classes) displayed in

More information

Kernel Density Construction Using Orthogonal Forward Regression

Kernel Density Construction Using Orthogonal Forward Regression Kernel ensity Construction Using Orthogonal Forward Regression S. Chen, X. Hong and C.J. Harris School of Electronics and Computer Science University of Southampton, Southampton SO7 BJ, U.K. epartment

More information

Writing Parallel Programs; Cost Model.

Writing Parallel Programs; Cost Model. CSE341T 08/30/2017 Lecture 2 Writing Parallel Programs; Cost Model. Due to physical and economical constraints, a typical machine we can buy now has 4 to 8 computing cores, and soon this number will be

More information

A Step by Step Guide to Learning SAS

A Step by Step Guide to Learning SAS A Step by Step Guide to Learning SAS 1 Objective Familiarize yourselves with the SAS programming environment and language. Learn how to create and manipulate data sets in SAS and how to use existing data

More information

EGR 111 Introduction to MATLAB

EGR 111 Introduction to MATLAB EGR 111 Introduction to MATLAB This lab introduces the MATLAB help facility, shows how MATLAB TM, which stands for MATrix LABoratory, can be used as an advanced calculator. This lab also introduces assignment

More information

Logical operators: R provides an extensive list of logical operators. These include

Logical operators: R provides an extensive list of logical operators. These include meat.r: Explanation of code Goals of code: Analyzing a subset of data Creating data frames with specified X values Calculating confidence and prediction intervals Lists and matrices Only printing a few

More information

Local Minima in Nonmetric Multidimensional Scaling

Local Minima in Nonmetric Multidimensional Scaling Local Minima in Nonmetric Multidimensional Scaling Michael A.A. Cox, School of Business, University of Newcastle Upon Tyne, Newcastle Upon Tyne, NE1 7RU. Trevor F.Cox, Department of Mathematics, University

More information

Essentials of PDV: Directing the Aim to Understanding the DATA Step! Arthur Xuejun Li, City of Hope National Medical Center, Duarte, CA

Essentials of PDV: Directing the Aim to Understanding the DATA Step! Arthur Xuejun Li, City of Hope National Medical Center, Duarte, CA PharmaSUG 2013 - Paper TF17 Essentials of PDV: Directing the Aim to Understanding the DATA Step! Arthur Xuejun Li, City of Hope National Medical Center, Duarte, CA ABSTRACT Beginning programmers often

More information

Statistical matching: conditional. independence assumption and auxiliary information

Statistical matching: conditional. independence assumption and auxiliary information Statistical matching: conditional Training Course Record Linkage and Statistical Matching Mauro Scanu Istat scanu [at] istat.it independence assumption and auxiliary information Outline The conditional

More information

LAB 2 VECTORS AND MATRICES

LAB 2 VECTORS AND MATRICES EN001-4: Intro to Computational Design Tufts University, Department of Computer Science Prof. Soha Hassoun LAB 2 VECTORS AND MATRICES 1.1 Background Overview of data types Programming languages distinguish

More information

COPYRIGHTED MATERIAL. Making Excel More Efficient

COPYRIGHTED MATERIAL. Making Excel More Efficient Making Excel More Efficient If you find yourself spending a major part of your day working with Excel, you can make those chores go faster and so make your overall work life more productive by making Excel

More information

Research Support. Processing Results in Stata

Research Support. Processing Results in Stata Most Stata functions (such as reg) display their results in the Stata results window. Sometimes this is not quite sufficient: we might want to either preserve some of the output and use it in future computations,

More information

16 Greedy Algorithms

16 Greedy Algorithms 16 Greedy Algorithms Optimization algorithms typically go through a sequence of steps, with a set of choices at each For many optimization problems, using dynamic programming to determine the best choices

More information

CS1114: Matlab Introduction

CS1114: Matlab Introduction CS1114: Matlab Introduction 1 Introduction The purpose of this introduction is to provide you a brief introduction to the features of Matlab that will be most relevant to your work in this course. Even

More information

CS4141 IDL Notes. I. Quick Overview of IDL Prototyping Unit

CS4141 IDL Notes. I. Quick Overview of IDL Prototyping Unit CS4141 IDL Notes IDL-800 Prototyping System The IDL-800 logic panels are powerful tools for any logic designer. They enable a wide range of IC s to be used in a breadboard experiment. I. Quick Overview

More information

REALCOM-IMPUTE: multiple imputation using MLwin. Modified September Harvey Goldstein, Centre for Multilevel Modelling, University of Bristol

REALCOM-IMPUTE: multiple imputation using MLwin. Modified September Harvey Goldstein, Centre for Multilevel Modelling, University of Bristol REALCOM-IMPUTE: multiple imputation using MLwin. Modified September 2014 by Harvey Goldstein, Centre for Multilevel Modelling, University of Bristol This description is divided into two sections. In the

More information

Do-it-yourself shuffling and the number of runs under randomness

Do-it-yourself shuffling and the number of runs under randomness The Stata Journal (2003) 3, Number 3, pp. 270 277 Do-it-yourself shuffling and the number of runs under randomness Nigel Smeeton King s College, London, UK nigel.smeeton@kcl.ac.uk Nicholas J. Cox University

More information

Similarity Image Retrieval System Using Hierarchical Classification

Similarity Image Retrieval System Using Hierarchical Classification Similarity Image Retrieval System Using Hierarchical Classification Experimental System on Mobile Internet with Cellular Phone Masahiro Tada 1, Toshikazu Kato 1, and Isao Shinohara 2 1 Department of Industrial

More information

Programming Exercise 3: Multi-class Classification and Neural Networks

Programming Exercise 3: Multi-class Classification and Neural Networks Programming Exercise 3: Multi-class Classification and Neural Networks Machine Learning Introduction In this exercise, you will implement one-vs-all logistic regression and neural networks to recognize

More information

Frequencies, Unequal Variance Weights, and Sampling Weights: Similarities and Differences in SAS

Frequencies, Unequal Variance Weights, and Sampling Weights: Similarities and Differences in SAS ABSTRACT Paper 1938-2018 Frequencies, Unequal Variance Weights, and Sampling Weights: Similarities and Differences in SAS Robert M. Lucas, Robert M. Lucas Consulting, Fort Collins, CO, USA There is confusion

More information

Algorithm Analysis. Gunnar Gotshalks. AlgAnalysis 1

Algorithm Analysis. Gunnar Gotshalks. AlgAnalysis 1 Algorithm Analysis AlgAnalysis 1 How Fast is an Algorithm? 1 Measure the running time» Run the program for many data types > Use System.currentTimeMillis to record the time Worst Time Average Best» Usually

More information

Introduction to Stata: An In-class Tutorial

Introduction to Stata: An In-class Tutorial Introduction to Stata: An I. The Basics - Stata is a command-driven statistical software program. In other words, you type in a command, and Stata executes it. You can use the drop-down menus to avoid

More information

MOST attention in the literature of network codes has

MOST attention in the literature of network codes has 3862 IEEE TRANSACTIONS ON INFORMATION THEORY, VOL. 56, NO. 8, AUGUST 2010 Efficient Network Code Design for Cyclic Networks Elona Erez, Member, IEEE, and Meir Feder, Fellow, IEEE Abstract This paper introduces

More information

Base and Advance SAS

Base and Advance SAS Base and Advance SAS BASE SAS INTRODUCTION An Overview of the SAS System SAS Tasks Output produced by the SAS System SAS Tools (SAS Program - Data step and Proc step) A sample SAS program Exploring SAS

More information

Point to Ellipse Distance: A Binary Search Approach

Point to Ellipse Distance: A Binary Search Approach Point to Ellipse Distance: A Binary Search Approach Zhikai Wang http://www.heteroclinic.net Montreal, Quebec, Canada e-mail: wangzhikai@yahoo.com url: Abstract: We give an algorithm to compute the shortest

More information

Finding MATLAB on CAEDM Computers

Finding MATLAB on CAEDM Computers Lab #1: Introduction to MATLAB Due Tuesday 5/7 at noon This guide is intended to help you start, set up and understand the formatting of MATLAB before beginning to code. For a detailed guide to programming

More information

REDCAP DATA DICTIONARY CLASS. November 9, 2017

REDCAP DATA DICTIONARY CLASS. November 9, 2017 REDCAP DATA DICTIONARY CLASS November 9, 2017 LEARNING OBJECTIVES Learn how to leverage the data dictionary Data dictionary basics Column descriptions Best practices Interplay with longitudinal features

More information

Hash-Based Indexing 1

Hash-Based Indexing 1 Hash-Based Indexing 1 Tree Indexing Summary Static and dynamic data structures ISAM and B+ trees Speed up both range and equality searches B+ trees very widely used in practice ISAM trees can be useful

More information

SHORTCUT METHODS FOR SIMPLEX- BASED SENSITIVITY ANALYSIS OF LINEAR PROGRAMMING AND RELATED SOFTWARE ISSUES. 1. Introduction 1. Muwafaq M.

SHORTCUT METHODS FOR SIMPLEX- BASED SENSITIVITY ANALYSIS OF LINEAR PROGRAMMING AND RELATED SOFTWARE ISSUES. 1. Introduction 1. Muwafaq M. International Journal for Quality Research 11(1) 29 22 ISSN 18-645 Muwafaq M. Alkubaisi 1 Article info: Received 18.7.216 Accepted 7.1.216 UDC 4.2 DOI 1.18421/IJQR11.1-13 SHORTCUT METHODS FOR SIMPLEX-

More information

Package blocksdesign

Package blocksdesign Type Package Package blocksdesign June 12, 2018 Title Nested and Crossed Block Designs for Factorial, Fractional Factorial and Unstructured Treatment Sets Version 2.9 Date 2018-06-11" Author R. N. Edmondson.

More information

Just tired of endless loops!

Just tired of endless loops! Just tired of endless loops! or parallel: Stata module for parallel computing George G. Vega Yon 1 Brian Quistorff 2 1 University of Southern California vegayon@usc.edu 2 Microsoft AI and Research Brian.Quistorff@microsoft.com

More information

Unit 7. Lesson 7.1. Loop. For Next Statements. Introduction. Loop

Unit 7. Lesson 7.1. Loop. For Next Statements. Introduction. Loop Loop Unit 7 Loop Introduction So far we have seen that each instruction is executed once and once only. Some time we may require that a group of instructions be executed repeatedly, until some logical

More information

Speeding Up the ARDL Estimation Command:

Speeding Up the ARDL Estimation Command: Speeding Up the ARDL Estimation Command: A Case Study in Efficient Programming in Stata and Mata Sebastian Kripfganz 1 Daniel C. Schneider 2 1 University of Exeter 2 Max Planck Institute for Demographic

More information

An Introduction to Stata Programming

An Introduction to Stata Programming An Introduction to Stata Programming Second Edition CHRISTOPHER F. BAUM Department of Economics and School of Social Work Boston College A Stata Press Publication StataCorp LP College Station, Texas Copyright

More information

Week 5: Multiple Linear Regression II

Week 5: Multiple Linear Regression II Week 5: Multiple Linear Regression II Marcelo Coca Perraillon University of Colorado Anschutz Medical Campus Health Services Research Methods I HSMP 7607 2017 c 2017 PERRAILLON ARR 1 Outline Adjusted R

More information

Graphical Analysis of Data using Microsoft Excel [2016 Version]

Graphical Analysis of Data using Microsoft Excel [2016 Version] Graphical Analysis of Data using Microsoft Excel [2016 Version] Introduction In several upcoming labs, a primary goal will be to determine the mathematical relationship between two variable physical parameters.

More information

Permutation Matrices. Permutation Matrices. Permutation Matrices. Permutation Matrices. Isomorphisms of Graphs. 19 Nov 2015

Permutation Matrices. Permutation Matrices. Permutation Matrices. Permutation Matrices. Isomorphisms of Graphs. 19 Nov 2015 9 Nov 25 A permutation matrix is an n by n matrix with a single in each row and column, elsewhere. If P is a permutation (bijection) on {,2,..,n} let A P be the permutation matrix with A ip(i) =, A ij

More information

Linear Equation Systems Iterative Methods

Linear Equation Systems Iterative Methods Linear Equation Systems Iterative Methods Content Iterative Methods Jacobi Iterative Method Gauss Seidel Iterative Method Iterative Methods Iterative methods are those that produce a sequence of successive

More information

Synthesis and FPGA-based Implementation of Hierarchical Finite State Machines from Specification in Handel-C

Synthesis and FPGA-based Implementation of Hierarchical Finite State Machines from Specification in Handel-C Synthesis and FPGA-based Implementation of Hierarchical Finite State Machines from Specification in Handel-C VALERY SKLYAROV Electronics and Telecommunications Department Aveiro University, IEETA Campus

More information

Akaike information criterion).

Akaike information criterion). An Excel Tool The application has three main tabs visible to the User and 8 hidden tabs. The first tab, User Notes, is a guide for the User to help in using the application. Here the User will find all

More information

A quick introduction to STATA

A quick introduction to STATA A quick introduction to STATA Data files and other resources for the course book Introduction to Econometrics by Stock and Watson is available on: http://wps.aw.com/aw_stock_ie_3/178/45691/11696965.cw/index.html

More information

Principles Of Econometrics Third Edition Solution Manual

Principles Of Econometrics Third Edition Solution Manual Principles Of Econometrics Third Edition Solution Manual If you are searched for a book Principles of econometrics third edition solution manual in pdf form, in that case you come on to faithful site.

More information

CS 5803 Introduction to High Performance Computer Architecture: Arithmetic Logic Unit. A.R. Hurson 323 CS Building, Missouri S&T

CS 5803 Introduction to High Performance Computer Architecture: Arithmetic Logic Unit. A.R. Hurson 323 CS Building, Missouri S&T CS 5803 Introduction to High Performance Computer Architecture: Arithmetic Logic Unit A.R. Hurson 323 CS Building, Missouri S&T hurson@mst.edu 1 Outline Motivation Design of a simple ALU How to design

More information

Key words. Bit-Counting, Bit-Parallelism, Counters, Document Retrieval, Frequency Division, Performance, Popcount.

Key words. Bit-Counting, Bit-Parallelism, Counters, Document Retrieval, Frequency Division, Performance, Popcount. International Journal of Information Technology, Vol. 9. No. Abstract BEATING THE POPCOUNT Dept. of Computer Science and Information Systems Jordan University of Science and Technology P.O. Box 33 Irbid

More information

STENO Introductory R-Workshop: Loading a Data Set Tommi Suvitaival, Steno Diabetes Center June 11, 2015

STENO Introductory R-Workshop: Loading a Data Set Tommi Suvitaival, Steno Diabetes Center June 11, 2015 STENO Introductory R-Workshop: Loading a Data Set Tommi Suvitaival, tsvv@steno.dk, Steno Diabetes Center June 11, 2015 Contents 1 Introduction 1 2 Recap: Variables 2 3 Data Containers 2 3.1 Vectors................................................

More information

TAGUCHI TECHNIQUES FOR 2 k FRACTIONAL FACTORIAL EXPERIMENTS

TAGUCHI TECHNIQUES FOR 2 k FRACTIONAL FACTORIAL EXPERIMENTS Hacettepe Journal of Mathematics and Statistics Volume 4 (200), 8 9 TAGUCHI TECHNIQUES FOR 2 k FRACTIONAL FACTORIAL EXPERIMENTS Nazan Danacıoğlu and F.Zehra Muluk Received 0: 0: 200 : Accepted 14: 06:

More information

Pace University. Fundamental Concepts of CS121 1

Pace University. Fundamental Concepts of CS121 1 Pace University Fundamental Concepts of CS121 1 Dr. Lixin Tao http://csis.pace.edu/~lixin Computer Science Department Pace University October 12, 2005 This document complements my tutorial Introduction

More information

Chapter Summary. Recursively defined Functions. Recursively defined sets and Structures Structural Induction

Chapter Summary. Recursively defined Functions. Recursively defined sets and Structures Structural Induction Section 5.3 1 Chapter Summary Recursively defined Functions. Recursively defined sets and Structures Structural Induction 5.3 Recursive definitions and structural induction A recursively defined picture

More information

EXPERIMENT #8: BINARY ARITHMETIC OPERATIONS

EXPERIMENT #8: BINARY ARITHMETIC OPERATIONS EE 2 Lab Manual, EE Department, KFUPM EXPERIMENT #8: BINARY ARITHMETIC OPERATIONS OBJECTIVES: Design and implement a circuit that performs basic binary arithmetic operations such as addition, subtraction,

More information

Microsoft Access 2010

Microsoft Access 2010 Microsoft Access 2010 Chapter 2 Querying a Database Objectives Create queries using Design view Include fields in the design grid Use text and numeric data in criteria Save a query and use the saved query

More information

Advanced Computer Architecture Lab 3 Scalability of the Gauss-Seidel Algorithm

Advanced Computer Architecture Lab 3 Scalability of the Gauss-Seidel Algorithm Advanced Computer Architecture Lab 3 Scalability of the Gauss-Seidel Algorithm Andreas Sandberg 1 Introduction The purpose of this lab is to: apply what you have learned so

More information

Time Complexity and Parallel Speedup to Compute the Gamma Summarization Matrix

Time Complexity and Parallel Speedup to Compute the Gamma Summarization Matrix Time Complexity and Parallel Speedup to Compute the Gamma Summarization Matrix Carlos Ordonez, Yiqun Zhang Department of Computer Science, University of Houston, USA Abstract. We study the serial and parallel

More information

Chapter 14 Global Search Algorithms

Chapter 14 Global Search Algorithms Chapter 14 Global Search Algorithms An Introduction to Optimization Spring, 2015 Wei-Ta Chu 1 Introduction We discuss various search methods that attempts to search throughout the entire feasible set.

More information

CS1114: Matlab Introduction

CS1114: Matlab Introduction CS1114: Matlab Introduction 1 Introduction The purpose of this introduction is to provide you a brief introduction to the features of Matlab that will be most relevant to your work in this course. Even

More information

On graphs of minimum skew rank 4

On graphs of minimum skew rank 4 On graphs of minimum skew rank 4 Sudipta Mallik a and Bryan L. Shader b a Department of Mathematics & Statistics, Northern Arizona University, 85 S. Osborne Dr. PO Box: 5717, Flagstaff, AZ 8611, USA b

More information

GAMs semi-parametric GLMs. Simon Wood Mathematical Sciences, University of Bath, U.K.

GAMs semi-parametric GLMs. Simon Wood Mathematical Sciences, University of Bath, U.K. GAMs semi-parametric GLMs Simon Wood Mathematical Sciences, University of Bath, U.K. Generalized linear models, GLM 1. A GLM models a univariate response, y i as g{e(y i )} = X i β where y i Exponential

More information

Space-filling curves for 2-simplicial meshes created with bisections and reflections

Space-filling curves for 2-simplicial meshes created with bisections and reflections Space-filling curves for 2-simplicial meshes created with bisections and reflections Dr. Joseph M. Maubach Department of Mathematics Eindhoven University of Technology Eindhoven, The Netherlands j.m.l.maubach@tue.nl

More information

Principles of Algorithm Design

Principles of Algorithm Design Principles of Algorithm Design When you are trying to design an algorithm or a data structure, it s often hard to see how to accomplish the task. The following techniques can often be useful: 1. Experiment

More information

Computer Programming: C++

Computer Programming: C++ The Islamic University of Gaza Engineering Faculty Department of Computer Engineering Fall 2017 ECOM 2003 Muath i.alnabris Computer Programming: C++ Experiment #7 Arrays Part II Passing Array to a Function

More information

Data Structures and Algorithms. Dynamic Programming

Data Structures and Algorithms. Dynamic Programming Data Structures and Algorithms Dynamic Programming Introduction Dynamic programming is simply the process of turning recursive calls in to table lookups. If a recursive function does redundant computations,

More information

Verbalizing Business Rules: Part 10

Verbalizing Business Rules: Part 10 Verbalizing Business Rules: Part 10 Terry Halpin rthface University Business rules should be validated by business domain experts, and hence specified using concepts and languages easily understood by

More information

Microsoft Access 2013

Microsoft Access 2013 Microsoft Access 2013 Chapter 2 Querying a Database Objectives Create queries using Design view Include fields in the design grid Use text and numeric data in criteria Save a query and use the saved query

More information

Microsoft Access 2013

Microsoft Access 2013 Microsoft Access 2013 Chapter 2 Querying a Database Objectives Create queries using Design view Include fields in the design grid Use text and numeric data in criteria Save a query and use the saved query

More information

Document Image Restoration Using Binary Morphological Filters. Jisheng Liang, Robert M. Haralick. Seattle, Washington Ihsin T.

Document Image Restoration Using Binary Morphological Filters. Jisheng Liang, Robert M. Haralick. Seattle, Washington Ihsin T. Document Image Restoration Using Binary Morphological Filters Jisheng Liang, Robert M. Haralick University of Washington, Department of Electrical Engineering Seattle, Washington 98195 Ihsin T. Phillips

More information

Sankalchand Patel College of Engineering - Visnagar Department of Computer Engineering and Information Technology. Assignment

Sankalchand Patel College of Engineering - Visnagar Department of Computer Engineering and Information Technology. Assignment Class: V - CE Sankalchand Patel College of Engineering - Visnagar Department of Computer Engineering and Information Technology Sub: Design and Analysis of Algorithms Analysis of Algorithm: Assignment

More information

Programming Exercise 4: Neural Networks Learning

Programming Exercise 4: Neural Networks Learning Programming Exercise 4: Neural Networks Learning Machine Learning Introduction In this exercise, you will implement the backpropagation algorithm for neural networks and apply it to the task of hand-written

More information

Density estimation. In density estimation problems, we are given a random from an unknown density. Our objective is to estimate

Density estimation. In density estimation problems, we are given a random from an unknown density. Our objective is to estimate Density estimation In density estimation problems, we are given a random sample from an unknown density Our objective is to estimate? Applications Classification If we estimate the density for each class,

More information

MAT 275 Laboratory 2 Matrix Computations and Programming in MATLAB

MAT 275 Laboratory 2 Matrix Computations and Programming in MATLAB MATLAB sessions: Laboratory MAT 75 Laboratory Matrix Computations and Programming in MATLAB In this laboratory session we will learn how to. Create and manipulate matrices and vectors.. Write simple programs

More information

Topic 9: Control Flow

Topic 9: Control Flow Topic 9: Control Flow COS 320 Compiling Techniques Princeton University Spring 2016 Lennart Beringer 1 The Front End The Back End (Intel-HP codename for Itanium ; uses compiler to identify parallelism)

More information

Statistical Good Practice Guidelines. 1. Introduction. Contents. SSC home Using Excel for Statistics - Tips and Warnings

Statistical Good Practice Guidelines. 1. Introduction. Contents. SSC home Using Excel for Statistics - Tips and Warnings Statistical Good Practice Guidelines SSC home Using Excel for Statistics - Tips and Warnings On-line version 2 - March 2001 This is one in a series of guides for research and support staff involved in

More information