Python Open Lab October 12

In this week, we continue to learn string, which is very important. Loop is also introduced. Examples like loop for a list, loop for a dictionary or loop for a string are taught. We learned some useful functions of string. len(str) — find the length of present string str.find(“ab”) — search a string in present […]

Read More…

Introduction to R ‘plm’ package (1)

This blog is an introduction to use ‘plm’ package for panel data analysis. Panel data means datasets with the same observations (respondents) and variables across different time units (such as year, month). And it’s common for researchers to have an unbalanced panel dataset in practice (for example, GDP data could be missing in different years […]

Read More…

R Open Lab Fall 2018 – More visualization

Today we will explore more about the advanced data visualization in R. First, we will review the basic graphical functions covered in the last open lab and learn how to use additional parameters to achieve different goals. Then, we will focus on the powerful package ggplot2. Here is the link to our open lab’s GitHub repository: https://github.com/wbh0912/R-Open-Lab-Fall-2018 If […]

Read More…

Introduction to R 'survey' package (3)

After defining your survey dataset (please refer back to ‘survey’ package blog (1) & (2) ), you could use the functions below to describe your survey data and estimate population. Let’s still use apiclus1 data. After svydesign() function, you have a designed survey dataset, dclus1, which we designed in the last week. In this dataset, […]

Read More…

R Open Lab Fall 2018 – Dataframe and basic visualization

This week we stepped into the most basic but important data structure called dataframe, several ways of constructing dataframes and importing dataframes are introduced. At the mean time, we reviewed the basic idea of extracting data by index/condition by giving some exercises to practice. Then, we focused on how to show the general picture of […]

Read More…

Introduction to R package ‘survey’ (2)

Here are more types of survey data except the case (simple random sample) we introduced before. The ‘survey’ package contains several sample datasets from the California Academic Performance Index. After installing and loading the ‘survey’ package, you could import these data samples using command: data(api). And you will see 5 datasets are loaded in R, […]

Read More…

Python Open Lab, October 5

In the Python Open Lab of this week, we learned list, dictionary, string. For list, it can store multiple elements and many useful functions about list are introduced. append(x) —   put an element to the tail of a list insert(x) —   insert an element to specific position of a list count(x) —   count number of […]

Read More…