Loading
      
  Sorry, something went wrong. Reload?
      Sorry, we cannot display this file.
      Sorry, this file is invalid so it cannot be displayed.
      
    
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | 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. | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | ######################################################## | |
| ##### 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") | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | ########################## | |
| ########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) | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | ########################### | |
| #######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) | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | ### 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 | 
NewerOlder