QPM Lab 2: Data Visualization & Descriptive Statistics in R and R Commander

Similar documents
Directions for Frequency Tables, Histograms, and Frequency Bar Charts

Excel Charts & Graphs

Getting Started With SPSS

How to Use a Data Spreadsheet: Excel

Using SPSS, Chapter 2: Descriptive Statistics

A Short Introduction to Eviews

Tutorial 2 Online and offline Ship Visualization tool Table of Contents

Step Sheet: Creating a Data Table and Charts

Descriptive Statistics

APPLYING BENFORD'S LAW This PDF contains step-by-step instructions on how to apply Benford's law using Microsoft Excel, which is commonly used by

Data representation and analysis in Excel

Appendix A How to create a data-sharing lab

Hands-on Exercise Using DataFerrett American Community Survey Public Use Microdata Sample (PUMS)

Adobe Acrobat X Pro Creating & Working with PDF Documents

Chapter 4 Displaying and Describing Categorical Data

Introduction to PASW Statistics

Introduction to SPSS 16.0

SHORT COURSE ON Stata SESSION ONE Getting Your Feet Wet with Stata

Recurring Billing. Gateway Recurring Billing Options: The gateway supports three separate recurring billing options:

Introduction to RStudio

IBM SPSS Statistics 20 Part 1: Descriptive Statistics

Microsoft SharePoint 2010 End User Quick Reference Card

CHRIS User Guide: Dated Information and Date Tracking

McAfee Endpoint Encryption Reporting Tool

Excel & Visual Basic for Applications (VBA)

Excel Tutorial. Bio 150B Excel Tutorial 1

Scatter Plots with Error Bars

Microsoft Project From the WBS to a Complete Schedule Emanuele Della Valle, Lecturer: Dario Cerizza

Subscribe to RSS in Outlook Find RSS Feeds. Exchange Outlook 2007 How To s / RSS Feeds 1of 7

Beginning Microsoft Project

WebEx Virtual Office Hours

My EA Builder 1.1 User Guide

MicroStrategy Desktop

Setting your session preferences

What Do You Think? for Instructors

A sample script file is displayed below: DRF271.SCR snap.125 grid.5 layer make vports color blue vports. zoom all

January 26, 2009 The Faculty Center for Teaching and Learning

Practical Exercise on PC. Create Climate files Daily time step. Solution of the exercise

A Guide to Stat/Transfer File Transfer Utility, Version 10

R Commander Tutorial

How to georectify an image in ArcMap 10

The Electronic Voting System - EVS

WebEx Sharing Resources

PURPOSE OF GRAPHS YOU ARE ABOUT TO BUILD. To explore for a relationship between the categories of two discrete variables

SmartLink for Lotus Notes User Guide

SmartLink for Outlook User Guide

Lasse Cronqvist. Tosmana. TOol for SMAll-N Analysis. version 1.2. User Manual

Installing a Browser Security Certificate for PowerChute Business Edition Agent

Changing the Wireless Settings on the WCB3000N

QGIS LAB SERIES GST 102: Spatial Analysis Lab 6: Vector Data Analysis - Network Analysis

Charting LibQUAL+(TM) Data. Jeff Stark Training & Development Services Texas A&M University Libraries Texas A&M University

LABSHEET 1: creating a table, primary keys and data types

1 One Dimensional Horizontal Motion Position vs. time Velocity vs. time

How to Format a Spreadsheet. provided by the OpenOffice.org Documentation Project

Using Stat/Transfer on the Linux/UNIX Systems

Doing Multiple Regression with SPSS. In this case, we are interested in the Analyze options so we choose that menu. If gives us a number of choices:

Hands on Microsoft Project (Part I) From a WBS to a Complete Schedule Emanuele Della Valle, Lecturer: Dario Cerizza

Mail Merge Creating Mailing Labels 3/23/2011

1 Intel Smart Connect Technology Installation Guide:

MoCo SMS Suite Quick Guides for Direct Marketing and CRM

Apple Remote Desktop User Guide

Client Marketing: Sets

NAIP Consortium Strengthening Statistical Computing for NARS SAS Enterprise Business Intelligence

Lab 3: Introduction to Data Acquisition Cards

GroupWise Calendar GroupWise Task Lists GroupWise Reminder Notes Recurring Events Proxy Access Shared Folders

Clinic Event Management System v5.1 Instruction Manual Nursing Module

Using Computer Programs for Quantitative Data Analysis

Beginner s Matlab Tutorial

User s Guide for Program CLAM (Classification Method)

Downloading Your Financial Statements to Excel

Introduction Course in SPSS - Evening 1

After you complete the survey, compare what you saw on the survey to the actual questions listed below:

Using Big Datasets in Stata

To Begin Customize Office

einstruction CPS (Clicker) Instructions

INTRODUCTION TO VIRTUAL DESKTOP BINGHAMTON UNIVERSITY

OUTLOOK WEB APP (OWA): MAIL

Integrated Company Analysis

Internet Explorer 7 for Windows XP: Obtaining MIT Certificates

Using Television and Radio programme for teaching

ASTP Online. Assisted School Travel Program. Student Rollover User Guide. NSW Department of Education

Excel macros made easy

Step 2: Save the file as an Excel file for future editing, adding more data, changing data, to preserve any formulas you were using, etc.

Data analysis and regression in Stata

TYPING IN ARABIC (WINDOWS XP)

This feature allows you to convert a collection of PDFs into EndNote references using the Digital Object Identifier (DOI).

There are various ways to find data using the Hennepin County GIS Open Data site:

Microsoft Excel Basics

Unit 13 Handling data. Year 4. Five daily lessons. Autumn term. Unit Objectives. Link Objectives

Excel for Data Cleaning and Management

To download and install directly to your phone

Appendix III: SPSS Preliminary

Microsoft Outlook 2007 Calendar Features

Using Algebra Tiles for Adding/Subtracting Integers and to Solve 2-step Equations Grade 7 By Rich Butera

EXCEL Tutorial: How to use EXCEL for Graphs and Calculations.

Transcription:

QPM Lab 2: Data Visualization & Descriptive Statistics in R and R Commander Viktoryia Schnose & Betul Demirkaya Department of Political Science Washington University, St. Louis September 4, 2013 Viktoryia Schnose & Betul Demirkaya QPM Lab 2: DataVisualization & Descriptive Statistics inrandrcommander 1

A Reminder From Last Class 1 Open R 2 Write the following in the command line: library(rcmdr) 3 This way, you open the package from the R library. It does not open automatically. 4 A new window should have opened. This is R commander. 5 Go to the website for QPM. 6 Open the Class Datasets. Viktoryia Schnose & Betul Demirkaya QPM Lab 2: DataVisualization & Descriptive Statistics inrandrcommander 2

Goals for the Class Reading a dataset & viewing the dataset with R commander Re-coding a variable to a factor Descriptive Statistics with R commander Bar graphs with R commander Viktoryia Schnose & Betul Demirkaya QPM Lab 2: DataVisualization & Descriptive Statistics inrandrcommander 3

Reading Data with R: Answering Two Questions 1 What type of file do you have?.csv = comma separated values.txt = text file.dta = STATA file.spss = SPSS file 2 Where is the file? Saved in your computer Online in a url Viktoryia Schnose & Betul Demirkaya QPM Lab 2: DataVisualization & Descriptive Statistics inrandrcommander 4

Reading Data with R:.csv or.txt STEP 1: What type of file are we using for the homework? Wednesday, September 7, 2011 Viktoryia Schnose & Betul Demirkaya QPM Lab 2: DataVisualization & Descriptive Statistics inrandrcommander 5

Reading Data with R:.csv or.txt STEP 2: Where is the file for the dataset for this week s HW? See Appendix for how to enter the URL. Viktoryia Schnose & Betul Demirkaya QPM Lab 2: DataVisualization & Descriptive Statistics inrandrcommander 6

Brazil Dataset: Viewing the Dataset Active Dataset Click here Variable name Observation number Wednesday, September 7, 2011 Viktoryia Schnose & Betul Demirkaya QPM Lab 2: DataVisualization & Descriptive Statistics inrandrcommander 7

Brazil Dataset: Converting vote variable into a factor = qualitative variable Wednesday, ViktoryiaSeptember Schnose 7, 2011 & Betul Demirkaya QPM Lab 2: DataVisualization & Descriptive Statistics inrandrcommander 8

Brazil Dataset: Converting vote variable into a factor = qualitative variable II Select vote variable. Viktoryia Schnose & Betul Demirkaya QPM Lab 2: DataVisualization & Descriptive Statistics inrandrcommander 9

Brazil Dataset: Converting vote variable into a factor = qualitative variable III Specify what each numeric value means (read the codebook). Viktoryia Schnose & Betul Demirkaya QPM Lab 2: DataVisualization & Descriptive Statistics inrandrcommander 10

Brazil Dataset: Frequency Distribution for vote variable Statistics Summaries Frequency distributions Wednesday, September 7, 2011 Viktoryia Schnose & Betul Demirkaya QPM Lab 2: DataVisualization & Descriptive Statistics inrandrcommander 11

Brazil Dataset: Bar Graph for vote variable (frequency) Graphs Bar Graph vote Frequency 0 200 400 600 800 no yes vote See Appendix for another way of presenting the same data. Viktoryia Schnose & Betul Demirkaya QPM Lab 2: DataVisualization & Descriptive Statistics inrandrcommander 12

In class assignment Break into groups of 3 or 4 individuals Fill out the sheet. ASK QUESTIONS. If you finish early, try to draw a bar graph for vote variable that shows probabilities. See Appendix for help. Viktoryia Schnose & Betul Demirkaya QPM Lab 2: DataVisualization & Descriptive Statistics inrandrcommander 13

Appendix: Table of Contents Using R & R Commander Reading.csv or.txt files from the internet Frequency distribution: Difference between R script and R output Another graph for vote variable showing probability R code to obtain the bar graph with probability Viktoryia Schnose & Betul Demirkaya QPM Lab 2: DataVisualization & Descriptive Statistics inrandrcommander 14

Using R & R Commander Drop down menus Toolbar Script Window: Here you will see R commands generated by the GUI. You can write commands here. Select them by highlighting them and press Submit Output Window: Dark Blue: printed output Red: command used Message Window: Red- Error Message Green - Warning Dark Blue - Other information Thursday, September 1, 2011 Viktoryia Schnose & Betul Demirkaya QPM Lab 2: DataVisualization & Descriptive Statistics inrandrcommander 15

Introduction Reading Data Re-coding a Variable Frequency Distribution Bar Graph Assignment Appendix Reading Data with R:.csv or.txt From the Internet STEP 3: Writing down the URL for the Brazil dataset. Prof. Montgomery s website Wednesday, September 7, 2011 Viktoryia Schnose & Betul Demirkaya QPM Lab 2: Data Visualization & Descriptive Statistics in R and R Commander 16

Difference between R Script and R Output Script Output Wednesday, September 7, 2011 Viktoryia Schnose & Betul Demirkaya QPM Lab 2: DataVisualization & Descriptive Statistics inrandrcommander 17

Brazil Dataset: Bar graph for vote variable (probability) Probability 0 20 40 60 80 no yes Did you vote in the last presidential election? Viktoryia Schnose & Betul Demirkaya QPM Lab 2: DataVisualization & Descriptive Statistics inrandrcommander 18

Brazil Dataset: Bar graph for vote variable (probability) This is how to modify the code to obtain the previous plot. Viktoryia Schnose & Betul Demirkaya QPM Lab 2: DataVisualization & Descriptive Statistics inrandrcommander 19