1.) If I have a data.frame df <- data.frame(a = c(1, 2, 3), b = c(4, 5, 6), c(7, 8, 9))...
1a.) How do I select the c(4, 5, 6)?
1b.) How do I select the 1?
1c.) How do I select the 5?
1d.) What is df[, 3]?
1.) If I have a data.frame df <- data.frame(a = c(1, 2, 3), b = c(4, 5, 6), c(7, 8, 9))...
1a.) How do I select the c(4, 5, 6)?
1b.) How do I select the 1?
1c.) How do I select the 5?
1d.) What is df[, 3]?
| ATL - Atlanta - FALCONS | |
| BUF - Buffalo - BILLS | |
| CHI - Chicago - BEARS | |
| CIN - Cincinnati - BENGALS | |
| CLE - Cleveland - BROWNS | |
| BAL - Baltimore - RAVENS | |
| DAL - Dallas - COWBOYS | |
| DEN - Denver - BRONCOS | |
| DET - Detroit - LIONS | |
| GB - Green Bay - PACKERS |
| #Load libraries | |
| library("XML") | |
| #Download fantasy football projections from FantasyPros.com | |
| qb_fp <- readHTMLTable("http://www.fantasypros.com/nfl/projections/qb.php", stringsAsFactors = FALSE)$data | |
| rb_fp <- readHTMLTable("http://www.fantasypros.com/nfl/projections/rb.php", stringsAsFactors = FALSE)$data | |
| wr_fp <- readHTMLTable("http://www.fantasypros.com/nfl/projections/wr.php", stringsAsFactors = FALSE)$data | |
| te_fp <- readHTMLTable("http://www.fantasypros.com/nfl/projections/te.php", stringsAsFactors = FALSE)$data |
| # The following script scrapes ESPN's MLB Standings Grid and writes the | |
| # standings for each American League (AL) team to a CSV file, which has the following | |
| # format: | |
| # Team, Opponent, Wins, Losses | |
| from bs4 import BeautifulSoup | |
| import urllib2 | |
| import re | |
| import csv |
| library(AER) | |
| library(lmtest) | |
| data("CollegeDistance") | |
| cd.d<-CollegeDistance | |
| simple.ed.1s<- lm(education ~ distance,data=cd.d) | |
| cd.d$ed.pred<- predict(simple.ed.1s) | |
| simple.ed.2s<- lm(wage ~ urban + gender + ethnicity + unemp + ed.pred , data=cd.d) | |
| simple.comp<- encomptest(wage ~ urban + gender + ethnicity + unemp + ed.pred , wage ~ urban + gender + ethnicity + unemp + education , data=cd.d) | |
| 1s.ftest<- encomptest(education ~ tuition + gender + ethnicity + urban , education ~ distance , data=cd.d) |