Skip to content

Instantly share code, notes, and snippets.

View cyrushhc's full-sized avatar

Cyrus Chuang cyrushhc

View GitHub Profile
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
NAME = "Cyrus Chuang"
COLLABORATORS = "None"
#CS110 Pre-class Work - Writing algorithms in Python--part I
###################################################################################################################
###################################################################################################################
#Question 1 [time estimate: 10 minutes]
#Palindromes are a sequence of characters (words, phrases, numbers) that can be read the same both from left to right and from right to left. Examples of palindromes include the word 'madam' and the number 12321.
########################################################
##### Scroll down to see the code modified / added #####
########################################################
foo <- read.csv("https://tinyurl.com/y2qv82ks")
# Only install the 2 packages below if not already installed
install.packages("date")
# install.packages("Matching")
##########################
########QUESTION 1########
##########################
##############
####PART A####
##############
foo <- read.csv(url("https://course-resources.minerva.kgi.edu/uploaded_files/mke/00089202-1711/daughters.csv"))
lm1 <- lm(foo$nowtot~ foo$hasgirls + foo$Dems + foo$Repubs + foo$Christian + foo$age + foo$srvlng + foo$demvote,data= foo)
###########################
#######Question 1##########
###########################
####(a) Replicating#####
sesame <- read.csv("https://tinyurl.com/wlgl63b")
plot(sesame$pre.test, sesame$post.test, xlab= "pretest score",ylab= "posttest score", xlim= c(20,120), ylim= c(20,120), main="grade 4" )
t <- which(sesame$treatment == 1)
c <- which(sesame$treatment == 0)
@cyrushhc
cyrushhc / gist:6b3ea8ddef214688a155a6ae4faa6db5
Last active January 24, 2020 15:50
CS112 - R Competency and The Drivetrain Approach to Decision Making
### Multilateral Development Institution Data
foo <- read.csv("https://tinyurl.com/yb4phxx8") # read in the data
# column names
names(foo)
# dimensions of the data set
dim(foo)
# quick look at the data structure