Commit d9265b30 authored by Oluwademilade Bolatimi's avatar Oluwademilade Bolatimi
Browse files

Upload New File

parent bbf2c41e
# NOTE: To load data, you must download both the extract's data and the DDI
# and also set the working directory to the folder with these files (or change the path below).
if (!require("ipumsr")) stop("Reading IPUMS data into R requires the ipumsr package. It can be installed using the following command: install.packages('ipumsr')")
ddi <- read_ipums_ddi("ipumsi_00003.xml")
data <- read_ipums_micro(ddi)
data
data$COUNTRY[COUNTRY = 'Jamaica']
ipums_view(data)
table(data$COUNTRY)
ipums_var_info(data$COUNTRY)
ipums_file_info(data)
read_ipums_micro_chunked(data)
data$COUNTRY[COUNTRY = "Jamaica"]
data$COUNTRY
head(data,10)
data[582331,]
jamaica <- filter(data,COUNTRY == 388 & INCWAGE != 0)
panama <- filter(data,COUNTRY == 591 & INCWAGE != 0)
Puerto_Rico <- filter(data,COUNTRY == 630 & INCWAGE != 0)
USA <- filter(data,COUNTRY == 840 & INCWAGE != 0)
summary(lm(USA$INCWAGE~USA$RACE))
mean(USA$RACE[USA$RACE == 20])
x = filter(USA, RACE == 10)
summary(x)
#newdata2 <- x[order(x$INCWAGE, decreasing = TRUE),]
lim = round(nrow(x)/2)
lim
newdata2 = x[lim-5000:lim+5000,]
summary(newdata2)
mean(newdata2$INCWAGE)
y = filter(USA, USA$RACE == 20)
summary(y)
lim2 = round(nrow(y)/2)
#newdata <- y[order(y$INCWAGE, decreasing = TRUE),]
newdatay = y[lim2-5000:lim2+5000,]
summary(newdatay)
mean(newdatay$INCWAGE)
summary(y)
z = filter(USA, USA$RACE > 49 & USA$RACE <= 59 & USA$RACE != 0)
ipums_val_labels(z$RACE)
summary(z)
z
summary(lm())
newdata <- z[order(z$INCWAGE, decreasing = FALSE),]
z = head(newdata,10000)
z
mean(z$INCWAGE)
z$INCWAGE
USA$RACE
Puerto_Rico
panama
panama
ipums_var_label(USA$RACE)
jamaica
ipums_var_desc(ddi,COUNTRY)
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment