In today’s open lab, we didn’t cover a lot. We first looked at how to generate random samples with certain conditions. Then we did an easy example of linear regression in R. The purpose of this lab is to let attendants understand how randomness works in R and how to use linear regression model for […]

## R Open Lab Fall 2018 – R Shiny

If you still haven’t got any idea of how amazing and powerful R can be, here is the time. In this open lab, I introduce my favourite part of R —- R shiny, which is a package to bulid interactive web app for data visualization, dashboard, map interaction and so on. I start from showing […]

## Python Open Lab November 9

This week we learned pandas, which is a package built on top of Numpy. It has Dataframe as its core data structure which is very useful for dealing with table data. Dataframe is made up of multidimensional arrays with rows and columns. It supports heterogeneous types and missing data, which is a great feature. Pandas […]

## Introduction to R ‘plm’ package (3)

In the ‘plm’ package blog (2), we’ve gotten regression outputs for both fixed and random effect models. One common question after getting regression output is to figure out which model should be chosen using Hausman test. The fixed effect output is names as “grun.fe” and the random effect output is names as “grun.re”. The function […]

## R Open Lab Fall 2018 – Data manipulation

Today we covered the topic of data manipulation. We first reviewed the basic ways to subset data frames such as logical expression and subset function. Then, we looked at ways to combine, merge, and split data frames. Finally, we covered the usage of package plyr. Here is the link to our open lab’s GitHub repository: https://github.com/wbh0912/R-Open-Lab-Fall-2018 […]

## Python Open Lab November 2

This week we learned about File IO. IO means input and output. So the content is basically about reading and writing file. Before doing any operations on file, we need to open the file. The command is open(filename, mode). ‘filename’ need to include the path of file. There are two ways to show the path, […]

## Python Open Lab October 26

This week we learned functions, which is very important for programmers. Functions are useful for procedural decomposition, maximize code reuse and minimize redundancy. Functions should be declared like a variable before using. def function(parameter1, parameter2…): do something return value ‘def’ is the keyword to show that we are defining a function. ‘function’ can be replaced […]

## Python Open Lab October 19

This week we mainly learned about condition statements. First we learned how to read user-input from console by using function input(). Input() can introduce user input to our program so user can define some values and program can get that. Then we looked at the definition of condition statement, which means when condition is met, […]

## 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 […]

## Introduction to R ‘plm’ package (2)

The first blog for “plm” package provides basic information about how to define panel data. This blog aims to introduce syntax for both fixed and random effects regression models. The dataset “Grunfeld” is a balanced panel of 10 observational units (firms) from 1935 to 1954, and we are going to use this dataset to run […]