R is also a powerful tool to deal with text data. This time we first clarified the concept between character and string by practicing some tricky examples and some basic ideas that we can play with our text data such as substring, combining and replacing. Then a txt file was introduced to let attendee play […]

# Month: October 2018

## Introduction to R ‘survey’ package (4)

In the previous 3 blogs, I have introduced how to define survey data and do descriptive statistics (here are the links for R ‘survey’ package blog (1) (2) (3)). Today, I am going to introduce basic regression syntax in this package. svyglm() # generalized linear regression using survey data Let’s use the two-stage cluster sample […]

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

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

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

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

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

## Python Open Lab, September 28

This week is the first week of Python Open Lab in fall 2018. We talked about fundamental concepts about Python and basic types and operations in Python. We first looked at the basic concept of programming languages and introduced python and its usage. The installation of Python for windows users were included so students can […]

## R Open Lab Fall 2018 – Functions, environment, and apply

The topic of this week is functions, environment, and apply family in R. We first cover the method of defining your own function in R, then we bring in the concept of environment since they are relevant. At last, we go over the apply family. Recall that we learned loops as one of the basic […]

## Introduction to R package ‘survey’ (1)

If you are using R for survey data analysis, you might find the ‘survey’ package is useful for you. I assume that you have already known how to read/import data in R, so this blog will skip the steps of data cleaning and loading. After importing survey data in R, here are some functions you […]