## Loading required package: zoo
##
## Attaching package: 'zoo'
## The following objects are masked from 'package:base':
##
## as.Date, as.Date.numeric
##
## Attaching package: 'dplyr'
## The following objects are masked from 'package:stats':
##
## filter, lag
## The following objects are masked from 'package:base':
##
## intersect, setdiff, setequal, union
##
## Attaching package: 'lubridate'
## The following objects are masked from 'package:base':
##
## date, intersect, setdiff, union
## Registered S3 method overwritten by 'quantmod':
## method from
## as.zoo.data.frame zoo
##
## Attaching package: 'psych'
## The following objects are masked from 'package:ggplot2':
##
## %+%, alpha
##
## Attaching package: 'scales'
## The following objects are masked from 'package:psych':
##
## alpha, rescale
url <- read_html("https://www.investing.com/commodities/gold-historical-data")
gold <- url %>% html_table(fill = TRUE)goldtable <- na.omit(gold)
goldtable = gold[[2]]
datatable(goldtable,options = list(scrollX = TRUE))##
## 1,913.40 1,915.00 1,915.10 1,915.40 1,917.90 1,921.00 1,925.10 1,927.10
## 1 1 1 1 1 1 1 1
## 1,929.40 1,929.50 1,931.00 1,932.50 1,933.95 1,936.10 1,937.10 1,938.90
## 1 1 1 1 1 1 1 1
## 1,956.60 1,957.55 1,961.70 1,963.80 1,964.05 1,964.40 1,969.45
## 1 1 1 1 1 1 1
## [1] 1957 1958 1964 1964 1962 1937 1931 1932 1915 1927 1934 1930 1929 1918 1913
## [16] 1915 1925 1921 1915 1936 1939 1964 1969
## Time Series:
## Start = 1
## End = 23
## Frequency = 1
## [1] 1,956.60 1,957.55 1,964.40 1,963.80 1,961.70 1,937.10 1,931.00 1,932.50
## [9] 1,915.40 1,927.10 1,933.95 1,929.50 1,929.40 1,917.90 1,913.40 1,915.10
## [17] 1,925.10 1,921.00 1,915.00 1,936.10 1,938.90 1,964.05 1,969.45
goldtable$Price <- as.numeric(gsub(",", "", goldtable$Price))
gold2 <- 100 * log(goldtable$Price[-1] / goldtable$Price[-nrow(goldtable)])
print(gold2)## [1] 0.048542 0.349316 -0.030548 -0.106993 -1.261943 -0.315401 0.077650
## [8] -0.888802 0.608980 0.354826 -0.230364 -0.005183 -0.597824 -0.234907
## [15] 0.088808 0.520807 -0.213203 -0.312826 1.095802 0.144516 1.288787
## [22] 0.274565
## vars n mean sd median trimmed mad min max range skew kurtosis se
## X1 1 22 0.03 0.58 0.02 0.02 0.43 -1.26 1.29 2.55 0.07 0.19 0.12
##
## Jarque Bera Test
##
## data: goldtable$Price
## X-squared = 2.1, df = 2, p-value = 0.3
##
## Augmented Dickey-Fuller Test
##
## data: goldtable$Price
## Dickey-Fuller = -0.15, Lag order = 2, p-value = 1
## alternative hypothesis: stationary
## Warning in pp.test(goldtable$Price): p-value greater than printed p-value
##
## Phillips-Perron Unit Root Test
##
## data: goldtable$Price
## Dickey-Fuller Z(alpha) = -0.36, Truncation lag parameter = 2, p-value =
## 1
## alternative hypothesis: stationary
Giá trị trung bình là -0.01
Độ lệch chuẩn là 0.58
Giá trị trung vị là -0.03
Giá trị trung bình (mean) sau khi cắt tỉa giá trị ngoại lai là -0.02
Gía trị nhỏ nhất là -1.26
Giá trị lớn nhất là 1.29
Phạm vi giữa giá trị nhỏ nhất và lớn nhất của biến: 2.55
Độ nhọn là 0.21
Hệ số độ lệch là 0.22
Kiểm định jarqye bera: 2.3
Kiểm định adf: -2
Kiểm định pp: -3.4
Bảng này trình bày thống kê mô tả tỷ suất sinh lời của vàng và các kiểm định có liên quan bao gồm kiểm định phân phối chuẩn, kiểm định nghiệm đơn vị. Kết quả cho thấy tỷ suất sinh lời âm (-0.01). Dựa vào độ lệch chuẩn thì chúng ta có thể thấy là biến động của vàng 0.58 khá lớn cho thấy nếu độ lệch chuân càng cao biến động sẽ xảy ra càng lớn. Hệ số độ lệch và độ nhọn lớn hơn so với phân phối chuẩn điều này được kiểm định một lần nữa thông qua kiểm định jarqye bera. Chúng tôi tiếp tục tiến hành kiểm định nghiệm đơn vị của dữ liệu mẫu. Với mức ý nghĩa 1% theo thống kê kiểm định ADF và kiểm định PP cho thấy toàn bộ các biến nghiên cứu là không có tính dừng. Chúng ta có thể kết luận
Nếu chuỗi thời gian không có tính chuỗi thời gian dừng, điều này cho biết rằng chuỗi thời gian không ổn định và có xu hướng thay đổi theo thời gian. Biến động không ổn định và có xu hướng thay đổi không dừng theo thời gian. Điều này có thể biểu thị sự biến đổi mạnh mẽ và không thể dự đoán được trong giá vàng.Việc dự báo giá vàng trở nên khó khăn hơn. Mô hình và phương pháp dự báo thường dựa trên giả định về tính chuỗi thời gian dừng để xác định xu hướng và mô hình hóa dữ liệu. Trong trường hợp này, mô hình dự báo có thể gặp khó khăn trong việc mô phỏng sự biến đổi giá vàng.Rủi ro đầu tư: Nếu biến động giá vàng không có tính chuỗi thời gian dừng, điều này có thể tạo ra rủi ro cao trong việc đầu tư vào vàng. Một biến động không ổn định và không dừng có thể gây ra sự không chắc chắn và khó dự đoán trong việc định giá vàng, và do đó có thể làm tăng rủi ro đầu tư.Tuy nhiên, để có một đánh giá chính xác về biến động của giá vàng, cần xem xét nhiều yếu tố khác nhau, bao gồm sự biến động ngắn hạn và dài hạn, yếu tố thị trường, tin tức kinh tế, và các yếu tố khác liên quan đến giá vàng.
## [1] NA NA 1960 1962 1963 1954 1943 1934 1926 1925 1925 1930 1931 1926 1920
## [16] 1915 1918 1920 1920 1924 1930 1946 1957
data <- data.frame( prices = goldtable$Price,sma = sma)
ggplot(data, aes(x = seq_along(prices))) +
geom_line(aes(y = prices), color = "blue") +
geom_line(aes(y = sma), color = "red") +
xlab("Index") +
ylab("Value") +
theme_bw()## Warning: Removed 2 rows containing missing values (`geom_line()`).
- Giá trị trung bình đơn giản (SMA) được tính bằng cách lấy trung bình
của các giá trị trong một cửa sổ trượt có độ dài nhất định. Trong trường
hợp này, bạn đã sử dụng cửa sổ trượt với độ dài n = 3. Điều này có nghĩa
là mỗi điểm dữ liệu trong dãy SMA được tính bằng cách lấy trung bình của
3 điểm dữ liệu gần nhất trong chuỗi giá vàng. Đường màu đỏ (SMA) biểu
thị xu hướng chung của chuỗi giá vàng. Nó là một dạng bộ lọc trượt đơn
giản để làm mờ nhiễu và tạo ra một hình dạng mượt mà hơn của dữ liệu
gốc. Điều này giúp hiển thị xu hướng chung và giảm độ biến động của
chuỗi giá vàng. - Đường màu xanh lá cây (goldtable$Price) biểu thị giá
vàng gốc, không qua xử lý. Nó thể hiện sự biến động và biên độ của giá
vàng theo thời gian.Việc so sánh đường SMA và đường giá vàng gốc trên
biểu đồ có thể giúp xác định xu hướng và biến động của giá vàng. Nếu
đường SMA tăng dần và nằm trên đường giá vàng gốc, điều này cho thấy xu
hướng tăng của giá vàng. Ngược lại, nếu đường SMA giảm dần và nằm dưới
đường giá vàng gốc, điều này cho thấy xu hướng giảm của giá vàng.
## [1] 1957 1958 1964 1964 1962 1937 1931 1932 1915 1927 1934 1930 1929 1918 1913
## [16] 1915 1925 1921 1915 1936 1939 1964 1969
- Sau khi biến đổi giá vàng về kiểu số thì chúng ta có thể vẽ biểu đồ
biến động giá, giá trong 7 ngày đàu thì biến động giá từ 1960 giảm còn
khoảng 1920, 8 ngày tiếp theo thì giá vàng đang tích lũy nên đi sideway,
sau đó thì giá vàng đã tăng mạnh từ 191x lên 1980.
population_data <- WDI(country = "US", indicator = c("SP.POP.TOTL"), start = 2010, end = 2022)
print(population_data)## country iso2c iso3c year SP.POP.TOTL
## 1 United States US USA 2022 333287557
## 2 United States US USA 2021 332031554
## 3 United States US USA 2020 331511512
## 4 United States US USA 2019 328329953
## 5 United States US USA 2018 326838199
## 6 United States US USA 2017 325122128
## 7 United States US USA 2016 323071755
## 8 United States US USA 2015 320738994
## 9 United States US USA 2014 318386329
## 10 United States US USA 2013 316059947
## 11 United States US USA 2012 313877662
## 12 United States US USA 2011 311583481
## 13 United States US USA 2010 309327143
## country iso2c iso3c year SP.POP.TOTL
## 1 United States US USA 2022 333287557
## 2 United States US USA 2021 332031554
## 3 United States US USA 2020 331511512
## 4 United States US USA 2019 328329953
## 5 United States US USA 2018 326838199
## 6 United States US USA 2017 325122128
## 7 United States US USA 2016 323071755
## 8 United States US USA 2015 320738994
## 9 United States US USA 2014 318386329
## 10 United States US USA 2013 316059947
## 11 United States US USA 2012 313877662
## 12 United States US USA 2011 311583481
## 13 United States US USA 2010 309327143
ggplot(df, aes(x = df$year, y = df$SP.POP.TOTL)) +
geom_line() +
labs(x = "Year", y = "Population", title = "Population of the US over Time") +
theme_bw()
- Nhận xét: Dân số của mỹ tăng dần theo thời gian từ năm 2010 - 2022,
tốc độ phát triển trung bình là 0.6237, dựa vào biểu đồ thì chúng ta có
thể thấy dân số nước Mỹ tăng liên tục từ năm 2010 đến 2022
Indicator của Tuổi thọ trung bình của dân số Mỹ = “SP.DYN.LE00.IN” - Sau đó in kết quả ra màn hình - Bạn có thể chuyển đổi nó thành khung dữ liệu - Sau đó vẽ biểu đồ
age <- WDI(indicator = "SP.DYN.LE00.IN", country = "US",extra = TRUE, start = 2010, end = 2022)
print(age)## country iso2c iso3c year SP.DYN.LE00.IN status lastupdated
## 1 United States US USA 2022 NA 2023-06-29
## 2 United States US USA 2021 76.33 2023-06-29
## 3 United States US USA 2020 76.98 2023-06-29
## 4 United States US USA 2019 78.79 2023-06-29
## 5 United States US USA 2018 78.64 2023-06-29
## 6 United States US USA 2017 78.54 2023-06-29
## 7 United States US USA 2016 78.54 2023-06-29
## 8 United States US USA 2015 78.69 2023-06-29
## 9 United States US USA 2014 78.84 2023-06-29
## 10 United States US USA 2013 78.74 2023-06-29
## 11 United States US USA 2012 78.74 2023-06-29
## 12 United States US USA 2011 78.64 2023-06-29
## 13 United States US USA 2010 78.54 2023-06-29
## region capital longitude latitude income lending
## 1 North America Washington D.C. -77.032 38.8895 High income Not classified
## 2 North America Washington D.C. -77.032 38.8895 High income Not classified
## 3 North America Washington D.C. -77.032 38.8895 High income Not classified
## 4 North America Washington D.C. -77.032 38.8895 High income Not classified
## 5 North America Washington D.C. -77.032 38.8895 High income Not classified
## 6 North America Washington D.C. -77.032 38.8895 High income Not classified
## 7 North America Washington D.C. -77.032 38.8895 High income Not classified
## 8 North America Washington D.C. -77.032 38.8895 High income Not classified
## 9 North America Washington D.C. -77.032 38.8895 High income Not classified
## 10 North America Washington D.C. -77.032 38.8895 High income Not classified
## 11 North America Washington D.C. -77.032 38.8895 High income Not classified
## 12 North America Washington D.C. -77.032 38.8895 High income Not classified
## 13 North America Washington D.C. -77.032 38.8895 High income Not classified
## country iso2c iso3c year SP.DYN.LE00.IN status lastupdated
## 1 United States US USA 2022 NA 2023-06-29
## 2 United States US USA 2021 76.33 2023-06-29
## 3 United States US USA 2020 76.98 2023-06-29
## 4 United States US USA 2019 78.79 2023-06-29
## 5 United States US USA 2018 78.64 2023-06-29
## 6 United States US USA 2017 78.54 2023-06-29
## 7 United States US USA 2016 78.54 2023-06-29
## 8 United States US USA 2015 78.69 2023-06-29
## 9 United States US USA 2014 78.84 2023-06-29
## 10 United States US USA 2013 78.74 2023-06-29
## 11 United States US USA 2012 78.74 2023-06-29
## 12 United States US USA 2011 78.64 2023-06-29
## 13 United States US USA 2010 78.54 2023-06-29
## region capital longitude latitude income lending
## 1 North America Washington D.C. -77.032 38.8895 High income Not classified
## 2 North America Washington D.C. -77.032 38.8895 High income Not classified
## 3 North America Washington D.C. -77.032 38.8895 High income Not classified
## 4 North America Washington D.C. -77.032 38.8895 High income Not classified
## 5 North America Washington D.C. -77.032 38.8895 High income Not classified
## 6 North America Washington D.C. -77.032 38.8895 High income Not classified
## 7 North America Washington D.C. -77.032 38.8895 High income Not classified
## 8 North America Washington D.C. -77.032 38.8895 High income Not classified
## 9 North America Washington D.C. -77.032 38.8895 High income Not classified
## 10 North America Washington D.C. -77.032 38.8895 High income Not classified
## 11 North America Washington D.C. -77.032 38.8895 High income Not classified
## 12 North America Washington D.C. -77.032 38.8895 High income Not classified
## 13 North America Washington D.C. -77.032 38.8895 High income Not classified
ggplot(df, aes(x = df$year, y = df$SP.DYN.LE00.IN)) +
geom_line() +
labs(x = "Year", y = "Tuổi thọ trung bình", title = "Tuổi thọ trung bình của dân mỹ từ năm 2010-2022") +
theme_bw()## Warning: Use of `df$year` is discouraged.
## ℹ Use `year` instead.
## Warning: Use of `df$SP.DYN.LE00.IN` is discouraged.
## ℹ Use `SP.DYN.LE00.IN` instead.
## Warning: Removed 1 row containing missing values (`geom_line()`).
- Nhận xét: Tuổi thọ của nước Mỹ từ năm 2010 - 2021 có xu hướng giảm dần
theo thời gian. Từ năm 2010 đến năm 2019 thì tuổi thọ của dân Mỹ tầm
78.5. Năm 2020 - 2021 thì tuổi thọ giảm xuống còn tầm 77 tuổi
ind <- WDIsearch('Economic')
d <- WDI(indicator = 'NY.GDP.MKTP.CD', country = 'US', extra = TRUE, start = 2010, end = 2022)
print(d)## country iso2c iso3c year NY.GDP.MKTP.CD status lastupdated
## 1 United States US USA 2022 2.546e+13 2023-06-29
## 2 United States US USA 2021 2.332e+13 2023-06-29
## 3 United States US USA 2020 2.106e+13 2023-06-29
## 4 United States US USA 2019 2.138e+13 2023-06-29
## 5 United States US USA 2018 2.053e+13 2023-06-29
## 6 United States US USA 2017 1.948e+13 2023-06-29
## 7 United States US USA 2016 1.870e+13 2023-06-29
## 8 United States US USA 2015 1.821e+13 2023-06-29
## 9 United States US USA 2014 1.755e+13 2023-06-29
## 10 United States US USA 2013 1.684e+13 2023-06-29
## 11 United States US USA 2012 1.625e+13 2023-06-29
## 12 United States US USA 2011 1.560e+13 2023-06-29
## 13 United States US USA 2010 1.505e+13 2023-06-29
## region capital longitude latitude income lending
## 1 North America Washington D.C. -77.032 38.8895 High income Not classified
## 2 North America Washington D.C. -77.032 38.8895 High income Not classified
## 3 North America Washington D.C. -77.032 38.8895 High income Not classified
## 4 North America Washington D.C. -77.032 38.8895 High income Not classified
## 5 North America Washington D.C. -77.032 38.8895 High income Not classified
## 6 North America Washington D.C. -77.032 38.8895 High income Not classified
## 7 North America Washington D.C. -77.032 38.8895 High income Not classified
## 8 North America Washington D.C. -77.032 38.8895 High income Not classified
## 9 North America Washington D.C. -77.032 38.8895 High income Not classified
## 10 North America Washington D.C. -77.032 38.8895 High income Not classified
## 11 North America Washington D.C. -77.032 38.8895 High income Not classified
## 12 North America Washington D.C. -77.032 38.8895 High income Not classified
## 13 North America Washington D.C. -77.032 38.8895 High income Not classified
d <- as.data.frame(d)
ggplot(d, aes(x = d$year, y = d$NY.GDP.MKTP.CD)) +
geom_line() +
labs(x = "Year", y = "GDP", title = "GDP của nước Mỹ 2010-2022") +
theme_bw()## Warning: Use of `d$year` is discouraged.
## ℹ Use `year` instead.
## Warning: Use of `d$NY.GDP.MKTP.CD` is discouraged.
## ℹ Use `NY.GDP.MKTP.CD` instead.
- Nhận xét: Chúng ta có thể thấy GDP của nước Mỹ tăng dần theo thời gian
từ năm 2010-2022, tuy nhiên năm 2019-2020 GDP của nước Mỹ giảm, trong
giai đoạn này thì GDP bị giảm do ảnh hưởng của Covid-19, sau đó thì thị
trường hồi phục trở lại.
population_data <- WDI(country = "US", indicator = c("NY.GDP.PCAP.CD"), start = 2010, end = 2022)
print(population_data)## country iso2c iso3c year NY.GDP.PCAP.CD
## 1 United States US USA 2022 76399
## 2 United States US USA 2021 70219
## 3 United States US USA 2020 63529
## 4 United States US USA 2019 65120
## 5 United States US USA 2018 62823
## 6 United States US USA 2017 59908
## 7 United States US USA 2016 57867
## 8 United States US USA 2015 56763
## 9 United States US USA 2014 55124
## 10 United States US USA 2013 53291
## 11 United States US USA 2012 51784
## 12 United States US USA 2011 50066
## 13 United States US USA 2010 48651
d <- as.data.frame(population_data)
ggplot(d, aes(x = d$year, y = d$NY.GDP.PCAP.CD)) +
geom_line() +
labs(x = "Year", y = "GDP trên đầu người", title = "GDP trên đầu người của nước Mỹ 2010-2022") +
theme_bw()
-Nhận xét: Cũng như GDP thì thì GDP bình quân đầu người cũng tăng gần
theo thời gian từ năm 2010-2022
## country iso2c iso3c year SI.POV.DDAY
## 1 United States US USA 2022 NA
## 2 United States US USA 2021 NA
## 3 United States US USA 2020 0.2
## 4 United States US USA 2019 1.0
## 5 United States US USA 2018 1.0
## 6 United States US USA 2017 1.2
## 7 United States US USA 2016 1.0
## 8 United States US USA 2015 1.2
## 9 United States US USA 2014 1.2
## 10 United States US USA 2013 1.0
## 11 United States US USA 2012 1.0
## 12 United States US USA 2011 1.0
## 13 United States US USA 2010 1.0
d <- as.data.frame(poverty)
ggplot(d, aes(x = d$year, y = d$SI.POV.DDAY)) +
geom_line() +
labs(x = "Year", y = "Tỷ lệ nghèo", title = "Tỷ lệ nghèo của nước Mỹ 2010-2022") +
theme_bw()## Warning: Removed 2 rows containing missing values (`geom_line()`).
- Nhận xét: Tỷ lệ nghèo của nước Mỹ đã giảm dần theo thời gian, từ năm
2010-2012 tỷ lệ nghèo là 1%, năm 2013-2019 thì tỷ lệ nghèo giao động
trong khoảng 1%-1.2%, sau đó thì tỷ lệ nghèo đã giảm xuống từ 1% còn
0.25%
## country iso2c iso3c year NE.CON.TOTL.CD
## 1 United States US USA 2022 NA
## 2 United States US USA 2021 1.926e+13
## 3 United States US USA 2020 1.725e+13
## 4 United States US USA 2019 1.740e+13
## 5 United States US USA 2018 1.677e+13
## 6 United States US USA 2017 1.596e+13
## 7 United States US USA 2016 1.536e+13
## 8 United States US USA 2015 1.487e+13
## 9 United States US USA 2014 1.441e+13
## 10 United States US USA 2013 1.390e+13
## 11 United States US USA 2012 1.356e+13
## 12 United States US USA 2011 1.321e+13
## 13 United States US USA 2010 1.277e+13
d <- as.data.frame(cpi)
ggplot(d, aes(x = d$year, y = d$NE.CON.TOTL.CD)) +
geom_line() +
labs(x = "Year", y = "Chi tiêu tiêu dùng", title = "Chi tiêu tiêu dùng của nước Mỹ 2010-2022") +
theme_bw()## Warning: Removed 1 row containing missing values (`geom_line()`).
- Nhận xét: Chi tiêu tiêu dùng tăng dần theo thời gian 2010 - 2022, năm
2010 thì chi tiêu tiêu dùng 2010 là 12,770,000,000,000 năm 2021 chi tiêu
tiêu dùng đã tăng lên 19,260,000,000,000. tăng lên 6,49000000000 USD,
Tuy nhiên trong quá trình tăng thì có năm 2019-2020 thì bị chuẩn lại xíu
do Covid 19. Tuy nhiên sau giai đoạn đó đã phát triển lại
Lạm phát (inflation) là một khái niệm kinh tế mô tả tình trạng tăng lên của mức giá hàng hóa và dịch vụ trong một khoảng thời gian dài. Nó dẫn đến giảm giá trị của đồng tiền và làm mất mua lực của người tiêu dùng.
Giá tiêu dùng (consumer prices) là mức giá trung bình của các mặt hàng và dịch vụ mà người tiêu dùng mua hàng ngày. Đây bao gồm thực phẩm, nhà ở, giao thông vận tải, y tế, giáo dục, và nhiều mặt hàng và dịch vụ khác.
Lạm phát và giá tiêu dùng có một mối quan hệ chặt chẽ. Khi lạm phát tăng, giá tiêu dùng cũng tăng theo. Điều này đồng nghĩa với việc người tiêu dùng phải trả nhiều hơn để mua cùng một lượng hàng hóa và dịch vụ. Ngược lại, khi lạm phát giảm, giá tiêu dùng cũng giảm, và người tiêu dùng có thể mua được nhiều hơn với cùng một số tiền.
Indicator Lạm phát, giá tiêu dùng là FP.CPI.TOTL.ZG
Sau đó in kết quả ra màn hình
Bạn có thể chuyển đổi nó thành khung dữ liệu
Sau đó vẽ biểu đồ
lamphat <- WDI(country = "US", indicator = "FP.CPI.TOTL.ZG", start = 2010, end = 2022)
print(lamphat)## country iso2c iso3c year FP.CPI.TOTL.ZG
## 1 United States US USA 2022 8.0028
## 2 United States US USA 2021 4.6979
## 3 United States US USA 2020 1.2336
## 4 United States US USA 2019 1.8122
## 5 United States US USA 2018 2.4426
## 6 United States US USA 2017 2.1301
## 7 United States US USA 2016 1.2616
## 8 United States US USA 2015 0.1186
## 9 United States US USA 2014 1.6222
## 10 United States US USA 2013 1.4648
## 11 United States US USA 2012 2.0693
## 12 United States US USA 2011 3.1568
## 13 United States US USA 2010 1.6400
d <- as.data.frame(lamphat)
ggplot(lamphat, aes(x = lamphat$year, y = lamphat$FP.CPI.TOTL.ZG)) +
geom_line() +
labs(x = "Year", y = "Lạm phát", title = "Lạm phát của nước Mỹ 2010-2022") +
theme_bw()
- Nhận xét: Lạm phát củ nước mỹ từ năm 2010- 2014 dao động trong khoản
từ 2% - 4% năm 2015 thì chỉ số lạm phát giảm gần như bằng 0 sau đó thì
tỷ lệ lạm phát tăng từ 0, mấy % lên 8%
unemployment <- WDI(country = "US", indicator = "SL.UEM.TOTL.ZS", start = 2010, end = 2022)
print(unemployment)## country iso2c iso3c year SL.UEM.TOTL.ZS
## 1 United States US USA 2022 3.611
## 2 United States US USA 2021 5.350
## 3 United States US USA 2020 8.050
## 4 United States US USA 2019 3.670
## 5 United States US USA 2018 3.900
## 6 United States US USA 2017 4.360
## 7 United States US USA 2016 4.870
## 8 United States US USA 2015 5.280
## 9 United States US USA 2014 6.170
## 10 United States US USA 2013 7.370
## 11 United States US USA 2012 8.070
## 12 United States US USA 2011 8.950
## 13 United States US USA 2010 9.630
d1 <- data.frame(unemployment)
ggplot(d1, aes(x = unemployment$year , y = unemployment$SL.UEM.TOTL.ZS)) +
geom_line() +
labs(x = "Year", y = "Tỷ lệ thất nghiệp ", title = "Tỷ lệ thất nghiệp của nước Mỹ 2010-2022") +
theme_bw()
- Nhận xét: Tỷ lệ thất nghiệp biến động tăng giảm liên tục năm 2010 -
2018 thì tỷ lệ thất nghiệp giảm từ gần 10% xuống còn hơn 3% sau đó thì
năm 2019-2022 thì tỷ lệ thất nghiệp giao động trong biên độ từ 4% - 8%,
từ năm 2019-2020 thì tỷ lệ thất ngiệp từ hơn 3% tăng lên 8% và sau đó
tỉnh lệ thất nghiệp đã giảm lại
## country iso2c iso3c year EN.ATM.CO2E.PC
## 1 United States US USA 2022 NA
## 2 United States US USA 2021 NA
## 3 United States US USA 2020 13.03
## 4 United States US USA 2019 14.67
## 5 United States US USA 2018 15.22
## 6 United States US USA 2017 14.82
## 7 United States US USA 2016 15.15
## 8 United States US USA 2015 15.56
## 9 United States US USA 2014 16.04
## 10 United States US USA 2013 16.11
## 11 United States US USA 2012 15.79
## 12 United States US USA 2011 16.60
## 13 United States US USA 2010 17.43
d <- data.frame(Co2)
ggplot(d, aes(x = Co2$year , y = Co2$EN.ATM.CO2E.PC)) +
geom_line() +
labs(x = "Year", y = "Lượng khí thải Co2 ", title = "Lượng khí thải Co2 của nước Mỹ 2010-2022") +
theme_bw()## Warning: Removed 2 rows containing missing values (`geom_line()`).
- Nhận xét: Lượng Khí Co2 giảm dần từ năm 2010 - 2020 từ 17.5 triệu tấn
xuống còn hơn 13 triệu tấn.
## country iso2c iso3c year SM.POP.NETM
## 1 United States US USA 2022 NA
## 2 United States US USA 2021 561580
## 3 United States US USA 2020 675560
## 4 United States US USA 2019 1158444
## 5 United States US USA 2018 1200796
## 6 United States US USA 2017 1377630
## 7 United States US USA 2016 1449371
## 8 United States US USA 2015 1221849
## 9 United States US USA 2014 1250914
## 10 United States US USA 2013 1320840
## 11 United States US USA 2012 1323368
## 12 United States US USA 2011 1322433
## 13 United States US USA 2010 1030731
d <- data.frame(dicu)
ggplot(d, aes(x = dicu$year , y = dicu$SM.POP.NETM)) +
geom_line() +
labs(x = "Year", y = "Di cư ròng ", title = " Di cư ròng của nước Mỹ 2010-2022") +
theme_bw()## Warning: Removed 1 row containing missing values (`geom_line()`).
- Nhận xét: Di cư ròng của nước mỹ từ 2010-2016 thì di cư ròng từ
1000000 người tăng lên hơn 12500000 người. Từ năm 2017- 2021 thì số dân
giảm từ 12500000 người xuống còn dưới 750000. ### Nợ của chính phủ trung
ương của nước Mỹ
## country iso2c iso3c year GC.DOD.TOTL.GD.ZS
## 1 United States US USA 2022 NA
## 2 United States US USA 2021 120.37
## 3 United States US USA 2020 126.23
## 4 United States US USA 2019 100.81
## 5 United States US USA 2018 99.06
## 6 United States US USA 2017 97.69
## 7 United States US USA 2016 98.50
## 8 United States US USA 2015 96.43
## 9 United States US USA 2014 95.77
## 10 United States US USA 2013 95.53
## 11 United States US USA 2012 93.65
## 12 United States US USA 2011 89.55
## 13 United States US USA 2010 84.96
d <- data.frame(no)
ggplot(d, aes(x = no$year , y = no$GC.DOD.TOTL.GD.ZS)) +
geom_line() +
labs(x = "Year", y = "Nợ của chính phủ trung ương ", title = " Nợ của chính phủ trung ương nước Mỹ 2010-2022") +
theme_bw()## Warning: Removed 1 row containing missing values (`geom_line()`).
-Nhận xét: Nợ chính phủ trung ương của nước mỹ tăng dần từ năm 2010 -
2020. Năm 2021 thì nợ chính phủ có dấu hiệu giảm. ### Thất nghiệp của
nước Mỹ
thatnghiep <- WDI(country = "US", indicator = "SL.UEM.TOTL.ZS", start = 2010, end = 2022)
print(thatnghiep)## country iso2c iso3c year SL.UEM.TOTL.ZS
## 1 United States US USA 2022 3.611
## 2 United States US USA 2021 5.350
## 3 United States US USA 2020 8.050
## 4 United States US USA 2019 3.670
## 5 United States US USA 2018 3.900
## 6 United States US USA 2017 4.360
## 7 United States US USA 2016 4.870
## 8 United States US USA 2015 5.280
## 9 United States US USA 2014 6.170
## 10 United States US USA 2013 7.370
## 11 United States US USA 2012 8.070
## 12 United States US USA 2011 8.950
## 13 United States US USA 2010 9.630
d <- data.frame(thatnghiep)
ggplot(d, aes(x = thatnghiep$year , y = thatnghiep$SL.UEM.TOTL.ZS)) +
geom_line() +
labs(x = "Year", y = "Thất nghiệp của nước Mỹ ", title = "Thất nghiệp của nước Mỹ nước Mỹ 2010-2022") +
theme_bw()
- Tỷ lệ thất nghiệp của nước Mỹ giảm dần từ năm 2010-2019 từ tầm 9%
xuống còn dưới 4%, xong từ năm 2019-2020 thì tỷ lệ thất nghiệp lại tăng
lên cho dịch Covid-19 sau đó thì giảm xuống do giai đoạn phụ hồi sau
covid-19.
gdp <- population_data$NY.GDP.PCAP.CD
CPI <- cpi$NE.CON.TOTL.CD
data <- data.frame(gdp,CPI)
ggplot(data, aes(x =population_data$NY.GDP.PCAP.CD, y = cpi$NE.CON.TOTL.CD)) +
geom_point() +
geom_smooth(method = "lm") +
labs(x = "GDP đầu người", y = "Chi tiêu tiêu dùng")## `geom_smooth()` using formula = 'y ~ x'
## Warning: Removed 1 rows containing non-finite values (`stat_smooth()`).
## Warning: Removed 1 rows containing missing values (`geom_point()`).
- Nhận xét:Đường cong hồi quy (line of best fit) trong biểu đồ có hướng
tăng dần, tức là nó nghiêng lên từ trái qua phải, điều đó cho thấy có
một mối quan hệ dương giữa GDP đầu người và chi tiêu tiêu dùng. Điều này
có thể có nghĩa là khi GDP đầu người tăng, chi tiêu tiêu dùng cũng tăng.
- Điểm dữ liệu trong biểu đồ cho thấy các giá trị cụ thể của GDP đầu
người và chi tiêu tiêu dùng tương ứng. Các điểm dữ liệu nằm gần đường
cong hồi quy cho thấy một mối quan hệ tương đối chặt chẽ giữa hai biến.
### Mối liên hệ giữa lạm phát và chi tiêu tiêu dùng nước Mỹ
## Warning: `data_frame()` was deprecated in tibble 1.1.0.
## ℹ Please use `tibble()` instead.
## This warning is displayed once every 8 hours.
## Call `lifecycle::last_lifecycle_warnings()` to see where this warning was
## generated.
ggplot(data, aes(x = lamphat$FP.CPI.TOTL.ZG , y = cpi$NE.CON.TOTL.CD)) +
geom_point() +
geom_smooth(method = "lm") +
labs(x = "Lạm phát", y = "Chi tiêu tiêu dùng")## `geom_smooth()` using formula = 'y ~ x'
## Warning: Removed 1 rows containing non-finite values (`stat_smooth()`).
## Warning: Removed 1 rows containing missing values (`geom_point()`).
- Khi lạm phát tăng lên thì chi tiêu tiêu dùng tăng lên tuy nhiên 2 biến
này không đó độ liên kết chặt chẽ với nhau
daudaihoc <- function(hocba, dgnl , thpt){
if(hocba == "yes" & dgnl == "yes" & thpt == "yes" )
return("success")
else("please make sure all are yes, this pandemic has to end!")
}formals(daudaihoc): Truy xuất các tham số (formals) của hàm daudaihoc. Kết quả: hocba, dgnl, thpt
body(daudaihoc): Truy xuất các lệnh (body) bên trong hàm daudaihoc.
## $hocba
##
##
## $dgnl
##
##
## $thpt
## {
## if (hocba == "yes" & dgnl == "yes" & thpt == "yes")
## return("success")
## else ("please make sure all are yes, this pandemic has to end!")
## }
## <environment: R_GlobalEnv>
## [1] "success"
## [1] "success"
## [1] "please make sure all are yes, this pandemic has to end!"
## [1] "please make sure all are yes, this pandemic has to end!"
daudaihoc(hocba = “yes” , dgnl = “yes” , thpt = “yes”): Gọi hàm daudaihoc với các đối số đã cho. Kết quả: “success”
daudaihoc(“yes”, “yes”, “yes”): Gọi hàm daudaihoc với các đối số đã cho. Kết quả: “success”
daudaihoc(hocba = “yes” , dgnl = “yes” , thpt = “no”): Gọi hàm daudaihoc với các đối số đã cho. Kết quả: “Please make sure all are yes. This pandemic has to end!”
daudaihoc(“yes”, “yes”, “no”): Gọi hàm daudaihoc với các đối số đã cho.
Kết quả: “Please make sure all are yes. This pandemic has to end!”
Đoạn mã được cung cấp đã được chỉnh sửa để kiểm tra loại dữ liệu đầu vào và trả về thông báo phù hợp nếu các giá trị không phù hợp được cung cấp. Dưới đây là phiên bản mới của đoạn mã:
daudaihoc <- function(hocba, dgnl, thpt) {
data <- data.frame(hocba, dgnl, thpt)
selected_data <- select(data, where(is.character))
if (ncol(selected_data) == 3) {
if (hocba == "yes" & dgnl == "yes" & thpt == "yes") {
return("success")
} else {
return("please make sure all are yes, this pandemic has to end!")
}
} else {
return("Invalid input types. Please provide character values for all variables.")
}
}
result <- daudaihoc("yes", "yes", "yes")
print(result)## [1] "success"
daudaihoc <- data.frame(
hocba = c("yes", "no", "yes", "yes"),
dgnl = c("no", "yes", "yes", "no"),
thpt = c("yes", "yes", "no", "yes"),
income = c(500, 700, 600, 800)
)
subset_data <- daudaihoc %>% slice_head(n = 2)
print(subset_data)## hocba dgnl thpt income
## 1 yes no yes 500
## 2 no yes yes 700
daudaihoc <- data.frame(
hocba = c("yes", "no", "yes", "yes"),
dgnl = c("no", "yes", "yes", "no"),
thpt = c("yes", "yes", "no", "yes"),
income = c(500, 700, 600, 800)
)
# Hàm chọn mỗi quan sát chia hết cho 2
select_every_second <- function(data) {
subset(data, seq_len(nrow(data)) %%2 == 0)
}
# Sử dụng hàm để chọn mỗi quan sát chia hết cho 2
result <- select_every_second(daudaihoc)
# In bộ số liệu đã chọn
print(result)## hocba dgnl thpt income
## 2 no yes yes 700
## 4 yes no yes 800
## Loading required package: car
## Loading required package: carData
##
## Attaching package: 'car'
## The following object is masked from 'package:psych':
##
## logit
## The following object is masked from 'package:dplyr':
##
## recode
## Loading required package: sandwich
## Loading required package: survival
## ── Attaching core tidyverse packages ──────────────────────── tidyverse 2.0.0 ──
## ✔ forcats 1.0.0 ✔ stringr 1.5.0
## ✔ purrr 1.0.1 ✔ tibble 3.2.1
## ✔ readr 2.1.4 ✔ tidyr 1.3.0
## ── Conflicts ────────────────────────────────────────── tidyverse_conflicts() ──
## ✖ psych::%+%() masks ggplot2::%+%()
## ✖ scales::alpha() masks psych::alpha(), ggplot2::alpha()
## ✖ readr::col_factor() masks scales::col_factor()
## ✖ purrr::discard() masks scales::discard()
## ✖ dplyr::filter() masks stats::filter()
## ✖ readr::guess_encoding() masks rvest::guess_encoding()
## ✖ dplyr::lag() masks stats::lag()
## ✖ car::recode() masks dplyr::recode()
## ✖ purrr::some() masks car::some()
## ℹ Use the conflicted package (<http://conflicted.r-lib.org/>) to force all conflicts to become errors
tiền công: Tiền lương (tính bằng đô la mỗi giờ).
giáo dục: Số năm học.
kinh nghiệm: Số năm kinh nghiệm làm việc tiềm năng (tuổi - trình độ học vấn - 6).
tuổi: Tuổi tính bằng năm.
dân tộc: Thừa số với các mức “cauc”, “hispanic”, “other”.
vùng đất: Cá nhân có sống ở miền Nam không?
giới tính: Yếu tố chỉ giới tính.
nghề nghiệp: Yếu tố có các mức độ “công nhân” (thợ hoặc công nhân dây chuyền lắp ráp), “kỹ thuật” (công nhân kỹ thuật hoặc chuyên nghiệp), “dịch vụ” (nhân viên dịch vụ), “văn phòng” (nhân viên văn phòng và thư ký), “bán hàng” (nhân viên bán hàng), “quản lý” (quản lý và điều hành).
lĩnh vực: Yếu tố có các mức độ “chế tạo” (chế tạo hoặc khai khoáng), “xây dựng”, “khác”.
liên hiệp: Cá nhân có làm công việc đoàn thể không?
Tình trạng hôn nhân: Cá nhân đã kết hôn chưa?
## wage education experience age ethnicity region gender occupation
## 1 5.10 8 21 35 hispanic other female worker
## 1100 4.95 9 42 57 cauc other female worker
## 2 6.67 12 1 19 cauc other male worker
## 3 4.00 12 4 22 cauc other male worker
## 4 7.50 12 17 35 cauc other male worker
## 5 13.07 13 9 28 cauc other male worker
## sector union married
## 1 manufacturing no yes
## 1100 manufacturing no yes
## 2 manufacturing no no
## 3 other no no
## 4 other no yes
## 5 other yes no
## wage education experience age ethnicity region gender occupation
## 528 11.79 16 6 28 cauc other female technical
## 529 11.36 18 5 29 cauc other male technical
## 530 6.10 12 33 51 other other female technical
## 531 23.25 17 25 48 other other female technical
## 532 19.88 12 13 31 cauc south male technical
## 533 15.38 16 33 55 cauc other male technical
## sector union married
## 528 other yes no
## 529 other no no
## 530 other no yes
## 531 other yes yes
## 532 other yes yes
## 533 manufacturing no yes
## wage education experience age ethnicity region gender
## 0 0 0 0 0 0 0
## occupation sector union married
## 0 0 0 0
cps <- CPS1985 %>%
mutate(genderx = case_when(
gender == "Male" ~ "Nam",
gender == "Female" ~ "Nữ"))
cps <- CPS1985 %>%
mutate(regionx= case_when(
region == "South" ~ "Phía Nam",
region == "Other" ~ "Khác"))
cps <- CPS1985 %>%
mutate(marriedx = case_when(
married == "Yes" ~ "Rồi",
married == "No" ~ "Chưa"))
cps <- CPS1985 %>%
mutate(occupation= case_when(
occupation == "worker" ~ "Công nhân",
occupation == "technical" ~ "Kỹ thuật",
occupation == "services" ~ "Dịch vụ",
occupation == "office" ~ "Văn phòng",
occupation == "sales" ~ "Bán hàng",
occupation == "management" ~ "Quản lý"))##
## no yes
## 184 350
CPS1985 %>% ggplot(aes(x = married )) +
geom_bar( fill ='black')+
labs(x='Tình trạng kết hôn', y = ' Số người')+
theme_light()CPS1985 %>% ggplot(aes(x = married , y = after_stat(count))) +
geom_bar(fill = 'red') +
geom_text(aes(label = scales::percent(after_stat(count/sum(count)))), stat = 'count', color = 'black', vjust = - .3) +
theme_classic() +
labs(x = 'Tình trạng kết hôn', y = 'Số người')
- Nhận xét: chúng ta thấy biểu đồ trên thể hiện tình trạng hôn nhân
trong đó thì số người kết hôn nhiều hơn số người chưa kết hôn là 166
người, trong đó thì số người chưa kết hôn là 184 người (chiếm tỷ lệ
34.46%), số người kết hôn là 350 người chiếm tỷ lệ 65.54%.
##
## male female
## 289 245
CPS1985 %>% ggplot(aes(x = gender )) +
geom_bar( fill ='black')+
labs(x='giới tính', y = ' Số người')+
theme_light()CPS1985 %>% ggplot(aes(x = gender , y = after_stat(count))) +
geom_bar(fill = 'black') +
geom_text(aes(label = scales::percent(after_stat(count/sum(count)))), stat = 'count', color = 'black', vjust = - .3) +
theme_classic() +
labs(x = 'giới tính', y = 'Số người')
- Nhận xét: số lượng người có giới tính nam nhiều hơn nữ, và nhiều hơn
44 người, trong đó nam chiếm 54,12% nữ chiếm 45,88%.
##
## no yes
## male 101 188
## female 83 162
##
## no yes
## male 0.1891 0.3521
## female 0.1554 0.3034
CPS1985 %>% ggplot(aes(x = gender , y = after_stat(count),fill= gender)) +
geom_bar() +
geom_text(aes(label = scales::percent(after_stat(count/sum(count)))), stat = 'count', color = 'black', vjust = - 0.3) +
facet_grid(. ~ married) +
theme_light() +
labs(x = 'Giới tính', y = 'Tình trạng hôn nhân')##
## Bán hàng Công nhân Dịch vụ Kỹ thuật Quản lý Văn phòng
## male 21 126 34 53 34 21
## female 17 30 49 52 21 76
##
## Bán hàng Công nhân Dịch vụ Kỹ thuật Quản lý Văn phòng
## male 0.03933 0.23596 0.06367 0.09925 0.06367 0.03933
## female 0.03184 0.05618 0.09176 0.09738 0.03933 0.14232
CPS1985 %>% ggplot(aes(x = gender , y = after_stat(count),fill= gender)) +
geom_bar() +
geom_text(aes(label = scales::percent(after_stat(count/sum(count)))), stat = 'count', color = 'black', vjust = - 0.3) +
facet_grid(. ~ occupation ) +
theme_light() +
labs(x = 'Giới tính', y = 'Nghề nghiệp')
- Nhận xét: số lượng công nhân nam chiếm 23.6%, số lượng công nhân nữ
chiếm 5.62%, số lượng kĩ thuật nam và nữ chỉ chênh nhau rất ít khoảng
0.2%, trong đó thì nam chiếm 9.93%, nữ chiếm 9.74%, dịch vụ số lượng nam
ít hơn nữ 15 người, trong đó thì nam chiếm 6.37%, còn nữ thì chiếm
9.18%, nhân viên văn phòng nam chiếm tỷ lệ thấp hơn nữ trong đó thì nam
chiếm 3.93% còn nữ chiếm 14.23%, nhân viên bán hàng nam chiếm 3.93% nữ
chiếm 3.18%, quản lý nam chiếm 6.34%, nữ chiếm 3.93%
##
## 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
## 11 12 15 18 16 15 17 18 19 15 23 11 18 23 28 18 22 15 11 14 13 7 10 6 11 10
## 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 54 55
## 10 8 8 8 6 4 8 15 5 3 4 5 9 5 3 4 7 7 5 6 2 2 1 1 1 1
CPS1985 %>% ggplot(aes(x = experience )) +
geom_bar( fill ='black')+
labs(x='Số năm kinh nghiệm', y = ' Số người')+
theme_light()
- Nhận xét: dựa vào biểu đồ số năm kinh nghiệm thì chúng ta có thể thấy
số người có số năm kinh nghiệm dưới 20 năm chiếu tỷ lệ lớn, còn số người
có 20 năm trở lên chiếm tỷ lệ ít hơn
##
## 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38
## (-0.055,27.5] 4 10 14 12 13 8 13 17 22 17 18 18 17 16 24 20 20 18 21 18 18
## (27.5,55.1] 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
##
## 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59
## (-0.055,27.5] 10 5 12 15 11 10 3 1 3 3 2 0 1 0 0 0 0 0 0 0 0
## (27.5,55.1] 0 0 0 0 2 1 4 7 4 3 3 6 8 7 9 7 9 8 9 2 3
##
## 60 61 62 63 64
## (-0.055,27.5] 0 0 0 0 0
## (27.5,55.1] 5 9 3 5 6
##
## 18 19 20 21 22 23 24 25
## 0 0.007491 0.007491 0.005618 0.000000 0.000000 0.000000 0.000000 0.000000
## 1 0.000000 0.009363 0.005618 0.003745 0.001873 0.000000 0.001873 0.000000
## 2 0.000000 0.001873 0.011236 0.003745 0.005618 0.000000 0.003745 0.001873
## 3 0.000000 0.000000 0.003745 0.013109 0.001873 0.000000 0.000000 0.007491
## 4 0.000000 0.000000 0.000000 0.001873 0.013109 0.001873 0.003745 0.001873
## 5 0.000000 0.000000 0.000000 0.000000 0.000000 0.013109 0.001873 0.001873
## 6 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.011236 0.001873
## 7 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.013109
## 8 0.000000 0.000000 0.000000 0.000000 0.001873 0.000000 0.000000 0.001873
## 9 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.001873
## 10 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000
## 11 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000
## 12 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000
## 13 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000
## 14 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000
## 15 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000
## 16 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.001873 0.000000
## 17 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000
## 18 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000
## 19 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000
## 20 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000
## 21 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000
## 22 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000
## 23 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000
## 24 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000
## 25 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000
## 26 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000
## 27 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000
## 28 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000
## 29 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000
## 30 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000
## 31 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000
## 32 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000
## 33 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000
## 34 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000
## 35 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000
## 36 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000
## 37 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000
## 38 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000
## 39 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000
## 40 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000
## 41 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000
## 42 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000
## 43 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000
## 44 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000
## 45 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000
## 46 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000
## 47 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000
## 48 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000
## 49 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000
## 54 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000
## 55 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000
##
## 26 27 28 29 30 31 32 33
## 0 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000
## 1 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000
## 2 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000
## 3 0.005618 0.001873 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000
## 4 0.007491 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000
## 5 0.001873 0.003745 0.001873 0.003745 0.000000 0.000000 0.000000 0.000000
## 6 0.003745 0.001873 0.011236 0.001873 0.000000 0.000000 0.000000 0.000000
## 7 0.001873 0.000000 0.000000 0.009363 0.003745 0.005618 0.000000 0.000000
## 8 0.020599 0.005618 0.000000 0.000000 0.003745 0.000000 0.001873 0.000000
## 9 0.000000 0.016854 0.003745 0.000000 0.001873 0.003745 0.000000 0.000000
## 10 0.000000 0.000000 0.011236 0.003745 0.005618 0.003745 0.013109 0.001873
## 11 0.000000 0.000000 0.001873 0.009363 0.000000 0.000000 0.001873 0.005618
## 12 0.000000 0.000000 0.001873 0.001873 0.014981 0.000000 0.007491 0.001873
## 13 0.000000 0.000000 0.000000 0.003745 0.001873 0.009363 0.001873 0.005618
## 14 0.000000 0.001873 0.000000 0.000000 0.000000 0.001873 0.016854 0.003745
## 15 0.000000 0.000000 0.001873 0.000000 0.000000 0.001873 0.001873 0.013109
## 16 0.000000 0.000000 0.000000 0.000000 0.000000 0.003745 0.000000 0.003745
## 17 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000
## 18 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000
## 19 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.001873
## 20 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000
## 21 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000
## 22 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000
## 23 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000
## 24 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000
## 25 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000
## 26 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000
## 27 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000
## 28 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000
## 29 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000
## 30 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000
## 31 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000
## 32 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000
## 33 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000
## 34 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000
## 35 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000
## 36 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000
## 37 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000
## 38 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000
## 39 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000
## 40 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000
## 41 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000
## 42 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000
## 43 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000
## 44 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000
## 45 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000
## 46 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000
## 47 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000
## 48 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000
## 49 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000
## 54 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000
## 55 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000
##
## 34 35 36 37 38 39 40 41
## 0 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000
## 1 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000
## 2 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000
## 3 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000
## 4 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000
## 5 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000
## 6 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000
## 7 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000
## 8 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000
## 9 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000
## 10 0.003745 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000
## 11 0.000000 0.001873 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000
## 12 0.001873 0.000000 0.003745 0.000000 0.000000 0.000000 0.000000 0.000000
## 13 0.001873 0.005618 0.007491 0.005618 0.000000 0.000000 0.000000 0.000000
## 14 0.007491 0.000000 0.009363 0.003745 0.007491 0.000000 0.000000 0.000000
## 15 0.001873 0.007491 0.000000 0.001873 0.001873 0.001873 0.000000 0.000000
## 16 0.016854 0.003745 0.003745 0.000000 0.007491 0.000000 0.000000 0.000000
## 17 0.003745 0.007491 0.003745 0.005618 0.000000 0.007491 0.000000 0.000000
## 18 0.000000 0.003745 0.007491 0.001873 0.000000 0.000000 0.003745 0.001873
## 19 0.000000 0.001873 0.000000 0.013109 0.000000 0.005618 0.000000 0.000000
## 20 0.000000 0.000000 0.001873 0.001873 0.016854 0.000000 0.001873 0.000000
## 21 0.000000 0.001873 0.000000 0.000000 0.000000 0.003745 0.000000 0.005618
## 22 0.000000 0.000000 0.001873 0.000000 0.000000 0.000000 0.003745 0.000000
## 23 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.009363
## 24 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.001873
## 25 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.001873
## 26 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000
## 27 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.001873
## 28 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000
## 29 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000
## 30 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000
## 31 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000
## 32 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000
## 33 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000
## 34 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000
## 35 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000
## 36 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000
## 37 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000
## 38 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000
## 39 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000
## 40 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000
## 41 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000
## 42 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000
## 43 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000
## 44 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000
## 45 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000
## 46 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000
## 47 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000
## 48 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000
## 49 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000
## 54 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000
## 55 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000
##
## 42 43 44 45 46 47 48 49
## 0 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000
## 1 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000
## 2 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000
## 3 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000
## 4 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000
## 5 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000
## 6 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000
## 7 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000
## 8 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000
## 9 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000
## 10 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000
## 11 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000
## 12 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000
## 13 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000
## 14 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000
## 15 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000
## 16 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000
## 17 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000
## 18 0.001873 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000
## 19 0.000000 0.003745 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000
## 20 0.001873 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000
## 21 0.000000 0.001873 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000
## 22 0.007491 0.000000 0.005618 0.000000 0.000000 0.000000 0.000000 0.000000
## 23 0.000000 0.000000 0.000000 0.000000 0.000000 0.001873 0.000000 0.000000
## 24 0.013109 0.000000 0.003745 0.000000 0.000000 0.001873 0.000000 0.000000
## 25 0.003745 0.009363 0.000000 0.001873 0.000000 0.000000 0.001873 0.000000
## 26 0.000000 0.000000 0.009363 0.000000 0.001873 0.001873 0.003745 0.001873
## 27 0.000000 0.005618 0.000000 0.003745 0.000000 0.000000 0.000000 0.001873
## 28 0.000000 0.000000 0.000000 0.001873 0.009363 0.001873 0.000000 0.000000
## 29 0.000000 0.003745 0.001873 0.000000 0.001873 0.003745 0.000000 0.000000
## 30 0.000000 0.000000 0.000000 0.003745 0.001873 0.000000 0.003745 0.001873
## 31 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000
## 32 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000
## 33 0.000000 0.000000 0.000000 0.001873 0.000000 0.001873 0.001873 0.001873
## 34 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.001873
## 35 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000
## 36 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000
## 37 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000
## 38 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000
## 39 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000
## 40 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000
## 41 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000
## 42 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000
## 43 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000
## 44 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000
## 45 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000
## 46 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000
## 47 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000
## 48 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000
## 49 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000
## 54 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000
## 55 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000
##
## 50 51 52 53 54 55 56 57
## 0 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000
## 1 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000
## 2 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000
## 3 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000
## 4 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000
## 5 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000
## 6 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000
## 7 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000
## 8 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000
## 9 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000
## 10 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000
## 11 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000
## 12 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000
## 13 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000
## 14 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000
## 15 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000
## 16 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000
## 17 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000
## 18 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000
## 19 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000
## 20 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000
## 21 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000
## 22 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000
## 23 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000
## 24 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000
## 25 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000
## 26 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000
## 27 0.000000 0.001873 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000
## 28 0.001873 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000
## 29 0.000000 0.001873 0.000000 0.001873 0.000000 0.000000 0.000000 0.000000
## 30 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000
## 31 0.001873 0.000000 0.001873 0.000000 0.001873 0.001873 0.000000 0.000000
## 32 0.005618 0.001873 0.003745 0.000000 0.000000 0.003745 0.000000 0.000000
## 33 0.001873 0.009363 0.001873 0.000000 0.001873 0.001873 0.000000 0.003745
## 34 0.000000 0.000000 0.003745 0.001873 0.001873 0.000000 0.000000 0.000000
## 35 0.000000 0.000000 0.000000 0.005618 0.000000 0.000000 0.000000 0.000000
## 36 0.000000 0.000000 0.000000 0.001873 0.003745 0.001873 0.000000 0.000000
## 37 0.000000 0.001873 0.000000 0.001873 0.001873 0.001873 0.000000 0.000000
## 38 0.000000 0.000000 0.001873 0.001873 0.001873 0.000000 0.009363 0.000000
## 39 0.000000 0.000000 0.000000 0.001873 0.000000 0.000000 0.001873 0.005618
## 40 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000
## 41 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.001873
## 42 0.000000 0.000000 0.000000 0.000000 0.000000 0.001873 0.001873 0.001873
## 43 0.000000 0.000000 0.000000 0.000000 0.000000 0.001873 0.001873 0.000000
## 44 0.000000 0.000000 0.000000 0.000000 0.000000 0.001873 0.000000 0.001873
## 45 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.001873
## 46 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000
## 47 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000
## 48 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000
## 49 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000
## 54 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000
## 55 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000
##
## 58 59 60 61 62 63 64
## 0 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000
## 1 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000
## 2 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000
## 3 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000
## 4 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000
## 5 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000
## 6 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000
## 7 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000
## 8 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000
## 9 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000
## 10 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000
## 11 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000
## 12 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000
## 13 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000
## 14 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000
## 15 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000
## 16 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000
## 17 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000
## 18 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000
## 19 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000
## 20 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000
## 21 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000
## 22 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000
## 23 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000
## 24 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000
## 25 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000
## 26 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000
## 27 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000
## 28 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000
## 29 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000
## 30 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000
## 31 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000
## 32 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000
## 33 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000
## 34 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000
## 35 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000
## 36 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000
## 37 0.000000 0.000000 0.000000 0.001873 0.000000 0.000000 0.000000
## 38 0.000000 0.000000 0.001873 0.000000 0.000000 0.000000 0.000000
## 39 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000
## 40 0.003745 0.000000 0.000000 0.000000 0.000000 0.000000 0.001873
## 41 0.000000 0.003745 0.000000 0.001873 0.000000 0.000000 0.000000
## 42 0.000000 0.000000 0.005618 0.000000 0.000000 0.000000 0.001873
## 43 0.000000 0.000000 0.000000 0.009363 0.000000 0.000000 0.000000
## 44 0.000000 0.000000 0.001873 0.000000 0.001873 0.000000 0.001873
## 45 0.000000 0.001873 0.000000 0.000000 0.001873 0.005618 0.000000
## 46 0.000000 0.000000 0.000000 0.001873 0.000000 0.000000 0.001873
## 47 0.000000 0.000000 0.000000 0.001873 0.001873 0.000000 0.000000
## 48 0.000000 0.000000 0.000000 0.000000 0.000000 0.001873 0.000000
## 49 0.000000 0.000000 0.000000 0.000000 0.000000 0.001873 0.000000
## 54 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.001873
## 55 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.001873
##
## 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
## 1 1 1 1 3 5 15 12 17 27 219 37 56 13 71 24 31
CPS1985 %>% ggplot(aes(x = education )) +
geom_bar( fill ='black')+
labs(x='Số năm giáo dục', y = ' Số người')+
theme_light()
- Nhận xét: Số người có trình độ học vấn lớp 12 chiếm tỷ lệ cao nhất 219
người, số người có trình độ đại học chiếm tỷ lệ tương đối cao và số
người có trình độ từ lớp 2 tới 11 chiếm tỷ lệ thấp.
##
## (1.98,6] (6,10] (10,14] (14,18]
## (-0.055,13.8] 0 5 145 81
## (13.8,27.5] 1 15 125 42
## (27.5,41.2] 1 17 54 15
## (41.2,55.1] 5 12 15 1
##
## (0.957,11.9] (11.9,22.8] (22.8,33.6] (33.6,44.5]
## (1.98,6] 6 1 0 0
## (6,10] 47 2 0 0
## (10,14] 281 55 2 1
## (14,18] 78 52 9 0
## # A tibble: 17 × 2
## `CPS1985$education` n
## <dbl> <dbl>
## 1 2 9.02
## 2 3 9.02
## 3 4 9.02
## 4 5 9.02
## 5 6 9.02
## 6 7 9.02
## 7 8 9.02
## 8 9 9.02
## 9 10 9.02
## 10 11 9.02
## 11 12 9.02
## 12 13 9.02
## 13 14 9.02
## 14 15 9.02
## 15 16 9.02
## 16 17 9.02
## 17 18 9.02
## # A tibble: 17 × 2
## `CPS1985$education` n
## <dbl> <dbl>
## 1 2 17.8
## 2 3 17.8
## 3 4 17.8
## 4 5 17.8
## 5 6 17.8
## 6 7 17.8
## 7 8 17.8
## 8 9 17.8
## 9 10 17.8
## 10 11 17.8
## 11 12 17.8
## 12 13 17.8
## 13 14 17.8
## 14 15 17.8
## 15 16 17.8
## 16 17 17.8
## 17 18 17.8
## # A tibble: 17 × 2
## `CPS1985$education` n
## <dbl> <dbl>
## 1 2 36.8
## 2 3 36.8
## 3 4 36.8
## 4 5 36.8
## 5 6 36.8
## 6 7 36.8
## 7 8 36.8
## 8 9 36.8
## 9 10 36.8
## 10 11 36.8
## 11 12 36.8
## 12 13 36.8
## 13 14 36.8
## 14 15 36.8
## 15 16 36.8
## 16 17 36.8
## 17 18 36.8
Nhận xét: lương trung bình 9.02 usd/h, số năm kinh nghiệm là 17.8 năm và tuổi trung bình là 36.8 tuổi
Dữ liệu chéo bắt nguồn từ Khảo sát dân số hiện tại tháng 5 năm 1985 của cục Điều tra dân số Hoa Kỳ (mẫu ngẫu nhiên rút ra cho Berndt 1991). Wage: Lương (tính bằng đô la mỗi giờ)
Education: Trình độ học vấn
Experience: Số năm kinh nghiệm làm việc
Age: tuổi tính bằng năm
ethnicity: Yếu tố dân tộc với các cấp độ “cauc”, “hispanic”, “other”.
Region Factor (khu vực sinh sống): có sống ở Miền Nam hay không?
gender: yếu tố chỉ giới tính
Occupation factor: Yếu tố nghề nghiệp với các mức độ “công nhân” (thợ hoặc công nhân dây chuyền lắp ráp), “kỹ thuật” , (nhân viên phục vụ), văn phòng và nhân viên văn thư,(nhân viên bán hàng), (quản lý và điều hành).
Sector : Yếu tố với các cấp độ “chế tạo” (chế tạo hoặc khai khoáng), “xây dựng”, “khác”.
union Factor: Cá nhân có làm công việc đoàn kết không?
married Factor: Cá nhân đã kết hôn chưa?
##
## Attaching package: 'data.table'
## The following object is masked from 'package:purrr':
##
## transpose
## The following objects are masked from 'package:lubridate':
##
## hour, isoweek, mday, minute, month, quarter, second, wday, week,
## yday, year
## The following objects are masked from 'package:dplyr':
##
## between, first, last
## wage education experience age ethnicity region gender occupation
## 1: 5.10 8 21 35 hispanic other female worker
## 2: 4.95 9 42 57 cauc other female worker
## 3: 6.67 12 1 19 cauc other male worker
## 4: 4.00 12 4 22 cauc other male worker
## 5: 7.50 12 17 35 cauc other male worker
## ---
## 530: 11.36 18 5 29 cauc other male technical
## 531: 6.10 12 33 51 other other female technical
## 532: 23.25 17 25 48 other other female technical
## 533: 19.88 12 13 31 cauc south male technical
## 534: 15.38 16 33 55 cauc other male technical
## sector union married
## 1: manufacturing no yes
## 2: manufacturing no yes
## 3: manufacturing no no
## 4: other no no
## 5: other no yes
## ---
## 530: other no no
## 531: other no yes
## 532: other yes yes
## 533: other yes yes
## 534: manufacturing no yes
-Vẽ biểu đồ Scatter Plot biến education theo age
` - Nhận xét:nhìn vào biểu đồ thì chúng ta thấy biểu đồ phân bố thấp ở
trình độ tiểu học và trung học và phân bố đều hơn ở cấp trung học và đại
học. Một điểm làm chúng ta chú ý là lớp 12 theo độ tuổi phân bố đều từ
20- trên 60 tuổi,điều đó có thể cho thấy rằng mức độ giáo dục tăng theo
độ tuổi. Ngược lại, nếu điểm trên biểu đồ không có xu hướng rõ ràng, có
thể không có mối quan hệ rõ ràng giữa giáo dục và độ tuổi. - Trong
trường hợp cần thiết chúng ta có thể vẽ thêm đường hồi quy (tuyến tính)
tương ứng với dữ liệu mà chúng ta dùng để vẽ đồ thị scatter như sau:
CPS1985 |> ggplot(aes(x = education, y = age)) +
geom_smooth(formula = y ~ x, method = 'lm', color = 'green') +
geom_point(color = 'red') ## $x
## [1] "Trình độ"
##
## $y
## [1] "Tuổi"
##
## $title
## [1] "Đồ Thị Dạng Scatter thể hiện trình độ theo độ tuổi"
##
## attr(,"class")
## [1] "labels"
CPS1985 |> ggplot(aes(x = education , y = age)) +
geom_point(color = 'blue') +
geom_line(color = 'black')CPS1985 |> ggplot(aes(x = education , y = wage )) +
geom_point(na.rm = T) +
xlab('Trình độ') +
ylab('Lương')
- Nhận xét: biểu đồ trên chúng ta có thể thấy trình độ học tỷ lệ thuận
với lương. Trình độ tiểu học thì lương chỉ khoảng từ 0-15 triệu, trình
độ từ lớp 6-9 thì lương cao nhất cũng tầm 20 triệu, trình độ cấp 3 lương
thấp hơn 23 triệu, trình độ đại học lương cao hơn đặc biệt có1 điểm
lương tầm 45 triệu
CPS1985 |> ggplot(aes(x = education, y = wage)) +
geom_smooth(formula = y ~ x, method = 'lm', color = 'green') +
geom_point(color = 'red') +
labs(title = 'Đồ Thị Dạng Scatter', x = 'Trình độ', y = 'Lương')
- Nhận xét: chúng ta thấy đường hồi quy tuyến tính có góc nghiêng dương,
điều đó cho thấy có xu hướng khi trình độ học vấn tăng thì lương cũng sẽ
tăng theo - Chúng ta có thể nối các điểm bằng đoạn thẳng:
CPS1985 |> ggplot(aes(x = education , y = wage)) +
geom_point(color = 'blue') +
geom_line(color = 'black')
- Nhận xét: nối các điểm này lại giúp chúng ta có thể nhìn rõ được sự
phân bố của trình độ học vấn và lương một cách rõ ràng hơn về sự phân bố
giữa các điểm - chúng ta có thể vẽ biểu đồ tương quan giữa biến trình độ
học vấn theo độ tuổi dựa trên biến nghề nghiệp
CPS1985 %>% ggplot(map= aes(x=education, y= wage))+ geom_point(color ='red')+ geom_line(color='black')+ labs(title = 'Sự tương quan giữa trình độ học vấn và lương', x = 'trình độ học vấn', y= 'lương')+ geom_smooth(formula = y ~ x, method = 'lm', color = 'green')
- Nhận xét: Biếu đồ này cho chúng ta thấy sự tương quan giữa trình độ
học vấn và lương, nếu trình độ học vấn càng cao thì lương cũng sẽ tăng
lên.
CPS1985 %>% ggplot(map=aes(x= education, y= wage, color= region ))+ geom_point() + labs(title = 'Sự tương quan giữa trình độ học vấn và lương', x='trình độ học vấn', y='lương') + geom_smooth(formula = y~x, method = 'lm', color= 'black')
- Nhận xét: Biểu đồ thể hiện sự tương quan giữa trình độ học vấn và
lương dựa trên khu vực chúng ta có thể thấy đa số là chấm xanh có nghĩa
là không phải ở phía nam, số chấm cam chiếm tỷ lệ ít hơn nghĩa là trình
độ học vấn theo lương ở khu vực này chiếm tỷ lệ thấp. Đường hồi quy
tuyến tính có độ nghiêng dương cho thấy trình độ học vấn tỷ lệ thuận với
lương nếu như trình độ cao thì lương cũng sẽ tăng.
CPS1985 %>% ggplot(map=aes(x= education, y= wage, color= occupation ))+ geom_point() + labs(title = 'Sự tương quan giữa trình độ học vấn và lương', x='trình độ học vấn', y='lương') + geom_smooth(formula = y~x, method = 'lm', color= 'black')
- Nhận xét: Biểu đồ thể hiện sự tương quan giữa trình độ học vấn và
luong dựa trên nghề nghiệp chúng ta thấy nghề nghiệp worker chỉ chiếm tỷ
lệ nhỏ ở cấp tiểu học và trung học, technical chiếm tỷ lệ lớn và chủ yếu
phân bố ở cấp 3 và đại học, ngành sevieces chiếm tỷ lệ vừa phải, phân bố
từ lớp 8 đến sau đại học, ngành office chiếm tỷ lệ ít chủ yếu là cấp 3
và đại học
cps |> ggplot(aes( x = gender, y = after_stat(count))) +
geom_bar(fill = 'gray') +
geom_text(aes(label = scales::percent( after_stat(count/sum(count)))), stat = 'count', color = 'black', vjust = 2) +
theme_classic() +
labs(x = 'giới tính', y = 'Số người')
- Nhận xét: trong biểu đồ cột giúp chúng biết giới tính nam chiểm số
lương cao hơn nữ là 289 người chiếm tỷ lệ 54.1%, nữ chiếm số lượng thấp
hơn 245 người chiếm tỷ lệ 45.9%. Số lượng nam cao hơn nữ 44 người. -
Biểu đồ cột thể hiện giới tính theo nghề nghiệp
CPS1985|> ggplot(aes(x = gender, y = after_stat(count))) +
geom_bar(fill = 'blue') +
geom_text(aes(label = scales::percent(after_stat(count/sum(count)))), stat = 'count', color = 'black', vjust = - .5) +
facet_grid(. ~ occupation ) +
# theme_classic() +
labs(x = 'Giới tính', y = 'nghề nghiệp')
- Nhận xét: biểu đồ cho thấy số lượng người làm nghề worker chiếm tỷ lệ
cao trong đó thì nam chiếm 23.6% còn nữ chiếm 5.62% chênh lệch nhau
17.98%, số người làm nghề technical chiếm tỷ lệ vừa phải và nam và nữ
chỉ chênh nhau 0.19, nghề servial chiếm tỷ lệ vừa phải và tỷ lệ phần
trăm của nữ chiếm tỷ lệ phần trăm lớn hơn nam là 2.81%, ngành office
chiếm tỷ lệ vừa phải và trong đó thì số lượng nữ chiếm tỷ lệ cao hơn nam
là 10,3%, ngành sale thì chiếm tỷ lệ thấp tỷ lệ chênh lệch giữa nam và
nữa là 0.75%, ngành mangagement chiếm tỷ lệ khá thấp 10,3% và nam chiếm
phần trăm lớn hơn nữ là 2.44% -Biểu đồ cột thể hiện giới tính theo tình
trạng hôn nhân
CPS1985|> ggplot(aes(x = gender, y = after_stat(count))) +
geom_bar(fill = 'blue') +
geom_text(aes(label = scales::percent(after_stat(count/sum(count)))), stat = 'count', color = 'red', vjust = - .5) + facet_grid(. ~ married) +
theme_classic() +
labs(x = 'Giới tính', y = 'Tình Trạng hôn nhân')
- Nhận xét: Biểu đồ trên cho chúng ta thấy giới tính theo tình trạng hôn
nhân, chúng ta có thể thấy là tình trạng hôn nhân chưa kết hôn chiếm tỷ
lệ 34.5% thấp hơn đã kết hôn (thấp hơn 31.1%), tỷ lệ nam chưa kết hôn
nhiều hơn nữ 3.4%, tình trạng kết hôn chiếm tỷ lệ cao 65.5%, tỷ lệ nam
kết hôn nhiều hơn nữ là 4.9%
library(tidyverse) ## Gọi các package trong thư viện ra
library(dplyr)
data("iris") #gọi database iris ra
iris %>% pivot_longer(Sepal.Length) ## pivot_longer giúp chúng ta có thể xoay dữ liệu biến Sepal. Length từ rộng sang dài ## # A tibble: 150 × 6
## Sepal.Width Petal.Length Petal.Width Species name value
## <dbl> <dbl> <dbl> <fct> <chr> <dbl>
## 1 3.5 1.4 0.2 setosa Sepal.Length 5.1
## 2 3 1.4 0.2 setosa Sepal.Length 4.9
## 3 3.2 1.3 0.2 setosa Sepal.Length 4.7
## 4 3.1 1.5 0.2 setosa Sepal.Length 4.6
## 5 3.6 1.4 0.2 setosa Sepal.Length 5
## 6 3.9 1.7 0.4 setosa Sepal.Length 5.4
## 7 3.4 1.4 0.3 setosa Sepal.Length 4.6
## 8 3.4 1.5 0.2 setosa Sepal.Length 5
## 9 2.9 1.4 0.2 setosa Sepal.Length 4.4
## 10 3.1 1.5 0.1 setosa Sepal.Length 4.9
## # ℹ 140 more rows
Kết quả cho thấy biến Sepal.Width,Petal.Length,Petal.Width ngoài ra còn các cột mới tên name có tên Sepal.Length và value của cột Sepal.Length,
Hàm pivot_longer không thể nhận biết được dấu chấm, nên chúng ta dùng ‘c()’ để chọn biến
## # A tibble: 300 × 5
## Sepal.Width Petal.Width Species name value
## <dbl> <dbl> <fct> <chr> <dbl>
## 1 3.5 0.2 setosa Sepal.Length 5.1
## 2 3.5 0.2 setosa Petal.Length 1.4
## 3 3 0.2 setosa Sepal.Length 4.9
## 4 3 0.2 setosa Petal.Length 1.4
## 5 3.2 0.2 setosa Sepal.Length 4.7
## 6 3.2 0.2 setosa Petal.Length 1.3
## 7 3.1 0.2 setosa Sepal.Length 4.6
## 8 3.1 0.2 setosa Petal.Length 1.5
## 9 3.6 0.2 setosa Sepal.Length 5
## 10 3.6 0.2 setosa Petal.Length 1.4
## # ℹ 290 more rows
## Sepal.Width Petal.Width Species
## 1 3.5 0.2 setosa
## 2 3.0 0.2 setosa
## 3 3.2 0.2 setosa
## 4 3.1 0.2 setosa
## 5 3.6 0.2 setosa
## 6 3.9 0.4 setosa
## 7 3.4 0.3 setosa
## 8 3.4 0.2 setosa
## 9 2.9 0.2 setosa
## 10 3.1 0.1 setosa
## 11 3.7 0.2 setosa
## 12 3.4 0.2 setosa
## 13 3.0 0.1 setosa
## 14 3.0 0.1 setosa
## 15 4.0 0.2 setosa
## 16 4.4 0.4 setosa
## 17 3.9 0.4 setosa
## 18 3.5 0.3 setosa
## 19 3.8 0.3 setosa
## 20 3.8 0.3 setosa
## 21 3.4 0.2 setosa
## 22 3.7 0.4 setosa
## 23 3.6 0.2 setosa
## 24 3.3 0.5 setosa
## 25 3.4 0.2 setosa
## 26 3.0 0.2 setosa
## 27 3.4 0.4 setosa
## 28 3.5 0.2 setosa
## 29 3.4 0.2 setosa
## 30 3.2 0.2 setosa
## 31 3.1 0.2 setosa
## 32 3.4 0.4 setosa
## 33 4.1 0.1 setosa
## 34 4.2 0.2 setosa
## 35 3.1 0.2 setosa
## 36 3.2 0.2 setosa
## 37 3.5 0.2 setosa
## 38 3.6 0.1 setosa
## 39 3.0 0.2 setosa
## 40 3.4 0.2 setosa
## 41 3.5 0.3 setosa
## 42 2.3 0.3 setosa
## 43 3.2 0.2 setosa
## 44 3.5 0.6 setosa
## 45 3.8 0.4 setosa
## 46 3.0 0.3 setosa
## 47 3.8 0.2 setosa
## 48 3.2 0.2 setosa
## 49 3.7 0.2 setosa
## 50 3.3 0.2 setosa
## 51 3.2 1.4 versicolor
## 52 3.2 1.5 versicolor
## 53 3.1 1.5 versicolor
## 54 2.3 1.3 versicolor
## 55 2.8 1.5 versicolor
## 56 2.8 1.3 versicolor
## 57 3.3 1.6 versicolor
## 58 2.4 1.0 versicolor
## 59 2.9 1.3 versicolor
## 60 2.7 1.4 versicolor
## 61 2.0 1.0 versicolor
## 62 3.0 1.5 versicolor
## 63 2.2 1.0 versicolor
## 64 2.9 1.4 versicolor
## 65 2.9 1.3 versicolor
## 66 3.1 1.4 versicolor
## 67 3.0 1.5 versicolor
## 68 2.7 1.0 versicolor
## 69 2.2 1.5 versicolor
## 70 2.5 1.1 versicolor
## 71 3.2 1.8 versicolor
## 72 2.8 1.3 versicolor
## 73 2.5 1.5 versicolor
## 74 2.8 1.2 versicolor
## 75 2.9 1.3 versicolor
## 76 3.0 1.4 versicolor
## 77 2.8 1.4 versicolor
## 78 3.0 1.7 versicolor
## 79 2.9 1.5 versicolor
## 80 2.6 1.0 versicolor
## 81 2.4 1.1 versicolor
## 82 2.4 1.0 versicolor
## 83 2.7 1.2 versicolor
## 84 2.7 1.6 versicolor
## 85 3.0 1.5 versicolor
## 86 3.4 1.6 versicolor
## 87 3.1 1.5 versicolor
## 88 2.3 1.3 versicolor
## 89 3.0 1.3 versicolor
## 90 2.5 1.3 versicolor
## 91 2.6 1.2 versicolor
## 92 3.0 1.4 versicolor
## 93 2.6 1.2 versicolor
## 94 2.3 1.0 versicolor
## 95 2.7 1.3 versicolor
## 96 3.0 1.2 versicolor
## 97 2.9 1.3 versicolor
## 98 2.9 1.3 versicolor
## 99 2.5 1.1 versicolor
## 100 2.8 1.3 versicolor
## 101 3.3 2.5 virginica
## 102 2.7 1.9 virginica
## 103 3.0 2.1 virginica
## 104 2.9 1.8 virginica
## 105 3.0 2.2 virginica
## 106 3.0 2.1 virginica
## 107 2.5 1.7 virginica
## 108 2.9 1.8 virginica
## 109 2.5 1.8 virginica
## 110 3.6 2.5 virginica
## 111 3.2 2.0 virginica
## 112 2.7 1.9 virginica
## 113 3.0 2.1 virginica
## 114 2.5 2.0 virginica
## 115 2.8 2.4 virginica
## 116 3.2 2.3 virginica
## 117 3.0 1.8 virginica
## 118 3.8 2.2 virginica
## 119 2.6 2.3 virginica
## 120 2.2 1.5 virginica
## 121 3.2 2.3 virginica
## 122 2.8 2.0 virginica
## 123 2.8 2.0 virginica
## 124 2.7 1.8 virginica
## 125 3.3 2.1 virginica
## 126 3.2 1.8 virginica
## 127 2.8 1.8 virginica
## 128 3.0 1.8 virginica
## 129 2.8 2.1 virginica
## 130 3.0 1.6 virginica
## 131 2.8 1.9 virginica
## 132 3.8 2.0 virginica
## 133 2.8 2.2 virginica
## 134 2.8 1.5 virginica
## 135 2.6 1.4 virginica
## 136 3.0 2.3 virginica
## 137 3.4 2.4 virginica
## 138 3.1 1.8 virginica
## 139 3.0 1.8 virginica
## 140 3.1 2.1 virginica
## 141 3.1 2.4 virginica
## 142 3.1 2.3 virginica
## 143 2.7 1.9 virginica
## 144 3.2 2.3 virginica
## 145 3.3 2.5 virginica
## 146 3.0 2.3 virginica
## 147 2.5 1.9 virginica
## 148 3.0 2.0 virginica
## 149 3.4 2.3 virginica
## 150 3.0 1.8 virginica
## Sepal.Length Petal.Length Species
## 1 5.1 1.4 setosa
## 2 4.9 1.4 setosa
## 3 4.7 1.3 setosa
## 4 4.6 1.5 setosa
## 5 5.0 1.4 setosa
## 6 5.4 1.7 setosa
## 7 4.6 1.4 setosa
## 8 5.0 1.5 setosa
## 9 4.4 1.4 setosa
## 10 4.9 1.5 setosa
## 11 5.4 1.5 setosa
## 12 4.8 1.6 setosa
## 13 4.8 1.4 setosa
## 14 4.3 1.1 setosa
## 15 5.8 1.2 setosa
## 16 5.7 1.5 setosa
## 17 5.4 1.3 setosa
## 18 5.1 1.4 setosa
## 19 5.7 1.7 setosa
## 20 5.1 1.5 setosa
## 21 5.4 1.7 setosa
## 22 5.1 1.5 setosa
## 23 4.6 1.0 setosa
## 24 5.1 1.7 setosa
## 25 4.8 1.9 setosa
## 26 5.0 1.6 setosa
## 27 5.0 1.6 setosa
## 28 5.2 1.5 setosa
## 29 5.2 1.4 setosa
## 30 4.7 1.6 setosa
## 31 4.8 1.6 setosa
## 32 5.4 1.5 setosa
## 33 5.2 1.5 setosa
## 34 5.5 1.4 setosa
## 35 4.9 1.5 setosa
## 36 5.0 1.2 setosa
## 37 5.5 1.3 setosa
## 38 4.9 1.4 setosa
## 39 4.4 1.3 setosa
## 40 5.1 1.5 setosa
## 41 5.0 1.3 setosa
## 42 4.5 1.3 setosa
## 43 4.4 1.3 setosa
## 44 5.0 1.6 setosa
## 45 5.1 1.9 setosa
## 46 4.8 1.4 setosa
## 47 5.1 1.6 setosa
## 48 4.6 1.4 setosa
## 49 5.3 1.5 setosa
## 50 5.0 1.4 setosa
## 51 7.0 4.7 versicolor
## 52 6.4 4.5 versicolor
## 53 6.9 4.9 versicolor
## 54 5.5 4.0 versicolor
## 55 6.5 4.6 versicolor
## 56 5.7 4.5 versicolor
## 57 6.3 4.7 versicolor
## 58 4.9 3.3 versicolor
## 59 6.6 4.6 versicolor
## 60 5.2 3.9 versicolor
## 61 5.0 3.5 versicolor
## 62 5.9 4.2 versicolor
## 63 6.0 4.0 versicolor
## 64 6.1 4.7 versicolor
## 65 5.6 3.6 versicolor
## 66 6.7 4.4 versicolor
## 67 5.6 4.5 versicolor
## 68 5.8 4.1 versicolor
## 69 6.2 4.5 versicolor
## 70 5.6 3.9 versicolor
## 71 5.9 4.8 versicolor
## 72 6.1 4.0 versicolor
## 73 6.3 4.9 versicolor
## 74 6.1 4.7 versicolor
## 75 6.4 4.3 versicolor
## 76 6.6 4.4 versicolor
## 77 6.8 4.8 versicolor
## 78 6.7 5.0 versicolor
## 79 6.0 4.5 versicolor
## 80 5.7 3.5 versicolor
## 81 5.5 3.8 versicolor
## 82 5.5 3.7 versicolor
## 83 5.8 3.9 versicolor
## 84 6.0 5.1 versicolor
## 85 5.4 4.5 versicolor
## 86 6.0 4.5 versicolor
## 87 6.7 4.7 versicolor
## 88 6.3 4.4 versicolor
## 89 5.6 4.1 versicolor
## 90 5.5 4.0 versicolor
## 91 5.5 4.4 versicolor
## 92 6.1 4.6 versicolor
## 93 5.8 4.0 versicolor
## 94 5.0 3.3 versicolor
## 95 5.6 4.2 versicolor
## 96 5.7 4.2 versicolor
## 97 5.7 4.2 versicolor
## 98 6.2 4.3 versicolor
## 99 5.1 3.0 versicolor
## 100 5.7 4.1 versicolor
## 101 6.3 6.0 virginica
## 102 5.8 5.1 virginica
## 103 7.1 5.9 virginica
## 104 6.3 5.6 virginica
## 105 6.5 5.8 virginica
## 106 7.6 6.6 virginica
## 107 4.9 4.5 virginica
## 108 7.3 6.3 virginica
## 109 6.7 5.8 virginica
## 110 7.2 6.1 virginica
## 111 6.5 5.1 virginica
## 112 6.4 5.3 virginica
## 113 6.8 5.5 virginica
## 114 5.7 5.0 virginica
## 115 5.8 5.1 virginica
## 116 6.4 5.3 virginica
## 117 6.5 5.5 virginica
## 118 7.7 6.7 virginica
## 119 7.7 6.9 virginica
## 120 6.0 5.0 virginica
## 121 6.9 5.7 virginica
## 122 5.6 4.9 virginica
## 123 7.7 6.7 virginica
## 124 6.3 4.9 virginica
## 125 6.7 5.7 virginica
## 126 7.2 6.0 virginica
## 127 6.2 4.8 virginica
## 128 6.1 4.9 virginica
## 129 6.4 5.6 virginica
## 130 7.2 5.8 virginica
## 131 7.4 6.1 virginica
## 132 7.9 6.4 virginica
## 133 6.4 5.6 virginica
## 134 6.3 5.1 virginica
## 135 6.1 5.6 virginica
## 136 7.7 6.1 virginica
## 137 6.3 5.6 virginica
## 138 6.4 5.5 virginica
## 139 6.0 4.8 virginica
## 140 6.9 5.4 virginica
## 141 6.7 5.6 virginica
## 142 6.9 5.1 virginica
## 143 5.8 5.1 virginica
## 144 6.8 5.9 virginica
## 145 6.7 5.7 virginica
## 146 6.7 5.2 virginica
## 147 6.3 5.0 virginica
## 148 6.5 5.2 virginica
## 149 6.2 5.4 virginica
## 150 5.9 5.1 virginica
## Petal.Width
## 1 0.2
## 2 0.2
## 3 0.2
## 4 0.2
## 5 0.2
## 6 0.4
## 7 0.3
## 8 0.2
## 9 0.2
## 10 0.1
## 11 0.2
## 12 0.2
## 13 0.1
## 14 0.1
## 15 0.2
## 16 0.4
## 17 0.4
## 18 0.3
## 19 0.3
## 20 0.3
## 21 0.2
## 22 0.4
## 23 0.2
## 24 0.5
## 25 0.2
## 26 0.2
## 27 0.4
## 28 0.2
## 29 0.2
## 30 0.2
## 31 0.2
## 32 0.4
## 33 0.1
## 34 0.2
## 35 0.2
## 36 0.2
## 37 0.2
## 38 0.1
## 39 0.2
## 40 0.2
## 41 0.3
## 42 0.3
## 43 0.2
## 44 0.6
## 45 0.4
## 46 0.3
## 47 0.2
## 48 0.2
## 49 0.2
## 50 0.2
## 51 1.4
## 52 1.5
## 53 1.5
## 54 1.3
## 55 1.5
## 56 1.3
## 57 1.6
## 58 1.0
## 59 1.3
## 60 1.4
## 61 1.0
## 62 1.5
## 63 1.0
## 64 1.4
## 65 1.3
## 66 1.4
## 67 1.5
## 68 1.0
## 69 1.5
## 70 1.1
## 71 1.8
## 72 1.3
## 73 1.5
## 74 1.2
## 75 1.3
## 76 1.4
## 77 1.4
## 78 1.7
## 79 1.5
## 80 1.0
## 81 1.1
## 82 1.0
## 83 1.2
## 84 1.6
## 85 1.5
## 86 1.6
## 87 1.5
## 88 1.3
## 89 1.3
## 90 1.3
## 91 1.2
## 92 1.4
## 93 1.2
## 94 1.0
## 95 1.3
## 96 1.2
## 97 1.3
## 98 1.3
## 99 1.1
## 100 1.3
## 101 2.5
## 102 1.9
## 103 2.1
## 104 1.8
## 105 2.2
## 106 2.1
## 107 1.7
## 108 1.8
## 109 1.8
## 110 2.5
## 111 2.0
## 112 1.9
## 113 2.1
## 114 2.0
## 115 2.4
## 116 2.3
## 117 1.8
## 118 2.2
## 119 2.3
## 120 1.5
## 121 2.3
## 122 2.0
## 123 2.0
## 124 1.8
## 125 2.1
## 126 1.8
## 127 1.8
## 128 1.8
## 129 2.1
## 130 1.6
## 131 1.9
## 132 2.0
## 133 2.2
## 134 1.5
## 135 1.4
## 136 2.3
## 137 2.4
## 138 1.8
## 139 1.8
## 140 2.1
## 141 2.4
## 142 2.3
## 143 1.9
## 144 2.3
## 145 2.5
## 146 2.3
## 147 1.9
## 148 2.0
## 149 2.3
## 150 1.8
## Petal.Length Petal.Width Sepal.Width
## 1 1.4 0.2 3.5
## 2 1.4 0.2 3.0
## 3 1.3 0.2 3.2
## 4 1.5 0.2 3.1
## 5 1.4 0.2 3.6
## 6 1.7 0.4 3.9
## 7 1.4 0.3 3.4
## 8 1.5 0.2 3.4
## 9 1.4 0.2 2.9
## 10 1.5 0.1 3.1
## 11 1.5 0.2 3.7
## 12 1.6 0.2 3.4
## 13 1.4 0.1 3.0
## 14 1.1 0.1 3.0
## 15 1.2 0.2 4.0
## 16 1.5 0.4 4.4
## 17 1.3 0.4 3.9
## 18 1.4 0.3 3.5
## 19 1.7 0.3 3.8
## 20 1.5 0.3 3.8
## 21 1.7 0.2 3.4
## 22 1.5 0.4 3.7
## 23 1.0 0.2 3.6
## 24 1.7 0.5 3.3
## 25 1.9 0.2 3.4
## 26 1.6 0.2 3.0
## 27 1.6 0.4 3.4
## 28 1.5 0.2 3.5
## 29 1.4 0.2 3.4
## 30 1.6 0.2 3.2
## 31 1.6 0.2 3.1
## 32 1.5 0.4 3.4
## 33 1.5 0.1 4.1
## 34 1.4 0.2 4.2
## 35 1.5 0.2 3.1
## 36 1.2 0.2 3.2
## 37 1.3 0.2 3.5
## 38 1.4 0.1 3.6
## 39 1.3 0.2 3.0
## 40 1.5 0.2 3.4
## 41 1.3 0.3 3.5
## 42 1.3 0.3 2.3
## 43 1.3 0.2 3.2
## 44 1.6 0.6 3.5
## 45 1.9 0.4 3.8
## 46 1.4 0.3 3.0
## 47 1.6 0.2 3.8
## 48 1.4 0.2 3.2
## 49 1.5 0.2 3.7
## 50 1.4 0.2 3.3
## 51 4.7 1.4 3.2
## 52 4.5 1.5 3.2
## 53 4.9 1.5 3.1
## 54 4.0 1.3 2.3
## 55 4.6 1.5 2.8
## 56 4.5 1.3 2.8
## 57 4.7 1.6 3.3
## 58 3.3 1.0 2.4
## 59 4.6 1.3 2.9
## 60 3.9 1.4 2.7
## 61 3.5 1.0 2.0
## 62 4.2 1.5 3.0
## 63 4.0 1.0 2.2
## 64 4.7 1.4 2.9
## 65 3.6 1.3 2.9
## 66 4.4 1.4 3.1
## 67 4.5 1.5 3.0
## 68 4.1 1.0 2.7
## 69 4.5 1.5 2.2
## 70 3.9 1.1 2.5
## 71 4.8 1.8 3.2
## 72 4.0 1.3 2.8
## 73 4.9 1.5 2.5
## 74 4.7 1.2 2.8
## 75 4.3 1.3 2.9
## 76 4.4 1.4 3.0
## 77 4.8 1.4 2.8
## 78 5.0 1.7 3.0
## 79 4.5 1.5 2.9
## 80 3.5 1.0 2.6
## 81 3.8 1.1 2.4
## 82 3.7 1.0 2.4
## 83 3.9 1.2 2.7
## 84 5.1 1.6 2.7
## 85 4.5 1.5 3.0
## 86 4.5 1.6 3.4
## 87 4.7 1.5 3.1
## 88 4.4 1.3 2.3
## 89 4.1 1.3 3.0
## 90 4.0 1.3 2.5
## 91 4.4 1.2 2.6
## 92 4.6 1.4 3.0
## 93 4.0 1.2 2.6
## 94 3.3 1.0 2.3
## 95 4.2 1.3 2.7
## 96 4.2 1.2 3.0
## 97 4.2 1.3 2.9
## 98 4.3 1.3 2.9
## 99 3.0 1.1 2.5
## 100 4.1 1.3 2.8
## 101 6.0 2.5 3.3
## 102 5.1 1.9 2.7
## 103 5.9 2.1 3.0
## 104 5.6 1.8 2.9
## 105 5.8 2.2 3.0
## 106 6.6 2.1 3.0
## 107 4.5 1.7 2.5
## 108 6.3 1.8 2.9
## 109 5.8 1.8 2.5
## 110 6.1 2.5 3.6
## 111 5.1 2.0 3.2
## 112 5.3 1.9 2.7
## 113 5.5 2.1 3.0
## 114 5.0 2.0 2.5
## 115 5.1 2.4 2.8
## 116 5.3 2.3 3.2
## 117 5.5 1.8 3.0
## 118 6.7 2.2 3.8
## 119 6.9 2.3 2.6
## 120 5.0 1.5 2.2
## 121 5.7 2.3 3.2
## 122 4.9 2.0 2.8
## 123 6.7 2.0 2.8
## 124 4.9 1.8 2.7
## 125 5.7 2.1 3.3
## 126 6.0 1.8 3.2
## 127 4.8 1.8 2.8
## 128 4.9 1.8 3.0
## 129 5.6 2.1 2.8
## 130 5.8 1.6 3.0
## 131 6.1 1.9 2.8
## 132 6.4 2.0 3.8
## 133 5.6 2.2 2.8
## 134 5.1 1.5 2.8
## 135 5.6 1.4 2.6
## 136 6.1 2.3 3.0
## 137 5.6 2.4 3.4
## 138 5.5 1.8 3.1
## 139 4.8 1.8 3.0
## 140 5.4 2.1 3.1
## 141 5.6 2.4 3.1
## 142 5.1 2.3 3.1
## 143 5.1 1.9 2.7
## 144 5.9 2.3 3.2
## 145 5.7 2.5 3.3
## 146 5.2 2.3 3.0
## 147 5.0 1.9 2.5
## 148 5.2 2.0 3.0
## 149 5.4 2.3 3.4
## 150 5.1 1.8 3.0
## Petal.Length
## 1 1.4
## 2 1.4
## 3 1.3
## 4 1.5
## 5 1.4
## 6 1.7
## 7 1.4
## 8 1.5
## 9 1.4
## 10 1.5
## 11 1.5
## 12 1.6
## 13 1.4
## 14 1.1
## 15 1.2
## 16 1.5
## 17 1.3
## 18 1.4
## 19 1.7
## 20 1.5
## 21 1.7
## 22 1.5
## 23 1.0
## 24 1.7
## 25 1.9
## 26 1.6
## 27 1.6
## 28 1.5
## 29 1.4
## 30 1.6
## 31 1.6
## 32 1.5
## 33 1.5
## 34 1.4
## 35 1.5
## 36 1.2
## 37 1.3
## 38 1.4
## 39 1.3
## 40 1.5
## 41 1.3
## 42 1.3
## 43 1.3
## 44 1.6
## 45 1.9
## 46 1.4
## 47 1.6
## 48 1.4
## 49 1.5
## 50 1.4
## 51 4.7
## 52 4.5
## 53 4.9
## 54 4.0
## 55 4.6
## 56 4.5
## 57 4.7
## 58 3.3
## 59 4.6
## 60 3.9
## 61 3.5
## 62 4.2
## 63 4.0
## 64 4.7
## 65 3.6
## 66 4.4
## 67 4.5
## 68 4.1
## 69 4.5
## 70 3.9
## 71 4.8
## 72 4.0
## 73 4.9
## 74 4.7
## 75 4.3
## 76 4.4
## 77 4.8
## 78 5.0
## 79 4.5
## 80 3.5
## 81 3.8
## 82 3.7
## 83 3.9
## 84 5.1
## 85 4.5
## 86 4.5
## 87 4.7
## 88 4.4
## 89 4.1
## 90 4.0
## 91 4.4
## 92 4.6
## 93 4.0
## 94 3.3
## 95 4.2
## 96 4.2
## 97 4.2
## 98 4.3
## 99 3.0
## 100 4.1
## 101 6.0
## 102 5.1
## 103 5.9
## 104 5.6
## 105 5.8
## 106 6.6
## 107 4.5
## 108 6.3
## 109 5.8
## 110 6.1
## 111 5.1
## 112 5.3
## 113 5.5
## 114 5.0
## 115 5.1
## 116 5.3
## 117 5.5
## 118 6.7
## 119 6.9
## 120 5.0
## 121 5.7
## 122 4.9
## 123 6.7
## 124 4.9
## 125 5.7
## 126 6.0
## 127 4.8
## 128 4.9
## 129 5.6
## 130 5.8
## 131 6.1
## 132 6.4
## 133 5.6
## 134 5.1
## 135 5.6
## 136 6.1
## 137 5.6
## 138 5.5
## 139 4.8
## 140 5.4
## 141 5.6
## 142 5.1
## 143 5.1
## 144 5.9
## 145 5.7
## 146 5.2
## 147 5.0
## 148 5.2
## 149 5.4
## 150 5.1
## Sepal.Length Sepal.Width Petal.Length Petal.Width Species
## 1 5.1 3.5 1.4 0.2 setosa
## 2 4.9 3.0 1.4 0.2 setosa
## 3 4.7 3.2 1.3 0.2 setosa
## 4 4.6 3.1 1.5 0.2 setosa
## 5 5.0 3.6 1.4 0.2 setosa
## 6 5.4 3.9 1.7 0.4 setosa
#Nhận xét: Có tất cả 6 giá trị phù hợp với đề bài yêu cầu
df1 <- data.frame(Sepal.Length = c(1:6), Product = c(rep("setosa", 3), rep("versicolor", 3)))
head(df1)## Sepal.Length Product
## 1 1 setosa
## 2 2 setosa
## 3 3 setosa
## 4 4 versicolor
## 5 5 versicolor
## 6 6 versicolor
## Sepal.Length Product
## 1 1 setosa
## 2 3 setosa
## 3 5 versicolor
d2 <- iris$Petal.Length + iris$Petal.Width #gán biến d2 bằng giá trị của cánh hoa cộng với chiều rộng cánh hoa
d3 <- iris$Petal.Width + 0.5 #gán biến d3 bằng giá trị chiều rộng của cánh hoa cộng thêm một giá trị nào đó bất kì trong trường hợp này tôi đặt đại 0.5
d4 <- data.frame(iris$Petal.Length,iris$Petal.Width ,d2) #nối tất cả các dữ liệu
d5 <- data.frame(d4, d3)
head(d5,4) #in cấu trúc dữ liệu ra## iris.Petal.Length iris.Petal.Width d2 d3
## 1 1.4 0.2 1.6 0.7
## 2 1.4 0.2 1.6 0.7
## 3 1.3 0.2 1.5 0.7
## 4 1.5 0.2 1.7 0.7
iris$daicut[iris$Petal.Length>=8] <- "dài"
iris$daicut[iris$Petal.Length <8 & iris$Petal.Length >=7 ] <- "vừa"
iris$daicut[iris$Petal.Length <7] <- "ngắn"
head(iris,4)## Sepal.Length Sepal.Width Petal.Length Petal.Width Species daicut
## 1 5.1 3.5 1.4 0.2 setosa ngắn
## 2 4.9 3.0 1.4 0.2 setosa ngắn
## 3 4.7 3.2 1.3 0.2 setosa ngắn
## 4 4.6 3.1 1.5 0.2 setosa ngắn
Lấy dữ liệu trong thư viện
library(AER)
###Lấy dữ liệu dataset CPS1985 từ package AER để tiến hành phân tích
data("CPS1985")
### Gán dữ liệu CPS1985 cho h
h <- CPS1985
### Xem cấu trúc dữ liệu gốc
str(h)## 'data.frame': 534 obs. of 11 variables:
## $ wage : num 5.1 4.95 6.67 4 7.5 ...
## $ education : num 8 9 12 12 12 13 10 12 16 12 ...
## $ experience: num 21 42 1 4 17 9 27 9 11 9 ...
## $ age : num 35 57 19 22 35 28 43 27 33 27 ...
## $ ethnicity : Factor w/ 3 levels "cauc","hispanic",..: 2 1 1 1 1 1 1 1 1 1 ...
## $ region : Factor w/ 2 levels "south","other": 2 2 2 2 2 2 1 2 2 2 ...
## $ gender : Factor w/ 2 levels "male","female": 2 2 1 1 1 1 1 1 1 1 ...
## $ occupation: Factor w/ 6 levels "worker","technical",..: 1 1 1 1 1 1 1 1 1 1 ...
## $ sector : Factor w/ 3 levels "manufacturing",..: 1 1 1 3 3 3 3 3 1 3 ...
## $ union : Factor w/ 2 levels "no","yes": 1 1 1 1 1 2 1 1 1 1 ...
## $ married : Factor w/ 2 levels "no","yes": 2 2 1 1 2 1 1 1 2 1 ...
## wage education experience age ethnicity region gender occupation
## 1 5.10 8 21 35 hispanic other female worker
## 1100 4.95 9 42 57 cauc other female worker
## 2 6.67 12 1 19 cauc other male worker
## 3 4.00 12 4 22 cauc other male worker
## 4 7.50 12 17 35 cauc other male worker
## 5 13.07 13 9 28 cauc other male worker
## sector union married
## 1 manufacturing no yes
## 1100 manufacturing no yes
## 2 manufacturing no no
## 3 other no no
## 4 other no yes
## 5 other yes no
## wage education experience age ethnicity region gender occupation
## 528 11.79 16 6 28 cauc other female technical
## 529 11.36 18 5 29 cauc other male technical
## 530 6.10 12 33 51 other other female technical
## 531 23.25 17 25 48 other other female technical
## 532 19.88 12 13 31 cauc south male technical
## 533 15.38 16 33 55 cauc other male technical
## sector union married
## 528 other yes no
## 529 other no no
## 530 other no yes
## 531 other yes yes
## 532 other yes yes
## 533 manufacturing no yes
## [1] 5.10 4.95 6.67 4.00 7.50 13.07 4.45 19.47 13.28 8.75 11.35 11.50
## [13] 6.50 6.25 19.98 7.30 8.00 22.20 3.65 20.55 5.71 7.00 3.75 4.50
## [25] 9.56 5.75 9.36 6.50 3.35 4.75 8.90 4.00 4.70 5.00 9.25 10.67
## [37] 7.61 10.00 7.50 12.20 3.35 11.00 12.00 4.85 4.30 6.00 15.00 4.85
## [49] 9.00 6.36 9.15 11.00 4.50 4.80 4.00 5.50 8.40 6.75 10.00 5.00
## [61] 6.50 10.75 7.00 11.43 4.00 9.00 13.00 12.22 6.28 6.75 3.35 16.00
## [73] 5.25 3.50 4.22 3.00 4.00 10.00 5.00 16.00 13.98 13.26 6.10 3.75
## [85] 9.00 9.45 5.50 8.93 6.25 9.75 6.73 7.78 2.85 3.35 19.98 8.50
## [97] 9.75 15.00 8.00 11.25 14.00 10.00 6.50 9.83 18.50 12.50 26.00 14.00
## [109] 10.50 11.00 12.47 12.50 15.00 6.00 9.50 5.00 3.75 12.57 6.88 5.50
## [121] 7.00 4.50 6.50 12.00 5.00 6.50 6.80 8.75 3.75 4.50 6.00 5.50
## [133] 13.00 5.65 4.80 7.00 5.25 3.35 8.50 6.00 6.75 8.89 14.21 10.78
## [145] 8.90 7.50 4.50 11.25 13.45 6.00 4.62 10.58 5.00 8.20 6.25 8.50
## [157] 24.98 16.65 6.25 4.55 11.25 21.25 12.65 7.50 10.25 3.35 13.45 4.84
## [169] 26.29 6.58 44.50 15.00 11.25 7.00 10.00 14.53 20.00 22.50 3.64 10.62
## [181] 24.98 6.00 19.00 13.20 22.50 15.00 6.88 11.84 16.14 13.95 13.16 5.30
## [193] 4.50 10.00 10.00 10.00 9.37 5.80 17.86 1.00 8.80 9.00 18.16 7.81
## [205] 10.62 4.50 17.25 10.50 9.22 15.00 22.50 4.55 9.00 13.33 15.00 7.50
## [217] 4.25 12.50 5.13 3.35 11.11 3.84 6.40 5.56 10.00 5.65 11.50 3.50
## [229] 3.35 4.75 19.98 3.50 4.00 7.00 6.25 4.50 14.29 5.00 13.75 13.71
## [241] 7.50 3.80 5.00 9.42 5.50 3.75 3.50 5.80 12.00 5.00 8.75 10.00
## [253] 8.50 8.63 9.00 5.50 11.11 10.00 5.20 8.00 3.56 5.20 11.67 11.32
## [265] 7.50 5.50 5.00 7.75 5.25 9.00 9.65 5.21 7.00 12.16 5.25 10.32
## [277] 3.35 7.70 9.17 8.43 4.00 4.13 3.00 4.25 7.53 10.53 5.00 15.03
## [289] 11.25 6.25 3.50 6.85 12.50 12.00 6.00 9.50 4.10 10.43 5.00 7.69
## [301] 5.50 6.40 12.50 6.25 8.00 9.60 9.10 7.50 5.00 7.00 3.55 8.50
## [313] 4.50 7.88 5.25 5.00 9.33 10.50 7.50 9.50 9.60 5.87 11.02 5.00
## [325] 5.62 12.50 10.81 5.40 7.00 4.59 6.00 11.71 5.62 5.50 4.85 6.75
## [337] 4.25 5.75 3.50 3.35 10.62 8.00 4.75 8.50 8.85 8.00 6.00 7.14
## [349] 3.40 6.00 3.75 8.89 4.35 13.10 4.35 3.50 3.80 5.26 3.35 16.26
## [361] 4.25 4.50 8.00 4.00 7.96 4.00 4.15 5.95 3.60 8.75 3.40 4.28
## [373] 5.35 5.00 7.65 6.94 7.50 3.60 1.75 3.45 9.63 8.49 8.99 3.65
## [385] 3.50 3.43 5.50 6.93 3.51 3.75 4.17 9.57 14.67 12.50 5.50 5.15
## [397] 8.00 5.83 3.35 7.00 10.00 8.00 6.88 5.55 7.50 8.93 9.00 3.50
## [409] 5.77 25.00 6.85 6.50 3.75 3.50 4.50 2.01 4.17 13.00 3.98 7.50
## [421] 13.12 4.00 3.95 13.00 9.00 4.55 9.50 4.50 8.75 10.00 18.00 24.98
## [433] 12.05 22.00 8.75 22.20 17.25 6.00 8.06 9.24 12.00 10.61 5.71 10.00
## [445] 17.50 15.00 7.78 7.80 10.00 24.98 10.28 15.00 12.00 10.58 5.85 11.22
## [457] 8.56 13.89 5.71 15.79 7.50 11.25 6.15 13.45 6.25 6.50 12.00 8.50
## [469] 8.00 5.75 15.73 9.86 13.51 5.40 6.25 5.50 5.00 6.25 5.75 20.50
## [481] 5.00 7.00 18.00 12.00 20.40 22.20 16.42 8.63 19.38 14.00 10.00 15.95
## [493] 20.00 10.00 24.98 11.25 22.83 10.20 10.00 14.00 12.50 5.79 24.98 4.35
## [505] 11.25 6.67 8.00 18.16 12.00 8.89 9.50 13.65 12.00 15.00 12.67 7.38
## [517] 15.56 7.45 6.25 6.25 9.37 22.50 7.50 7.00 5.75 7.67 12.50 16.00
## [529] 11.79 11.36 6.10 23.25 19.88 15.38
## [1] 9.024
#Nhận xét lương trung bình của một người là 9.024064 (đv)
#Tính lương trung bình theo giới tính:
aggregate(h$wage, list(h$gender), FUN = "mean")## Group.1 x
## 1 male 9.995
## 2 female 7.879
#Nhận xét: ta có sự chênh lệch số lương nam nhiều hơn nữ là 2.120273 đơn vị, số lương trung bình của nam là 9.994913 đơn vị và lương trung bình của nữ là 7.878857 đơn vị
#Độ lệch chuẩn
sd(h$wage)## [1] 5.139
## [1] 26.41
## 50%
## 7.78
## [1] 35 57 19 22 35 28 43 27 33 27 35 37 41 45 44 55 57 44 33 51 34 55 27 31 41
## [26] 57 26 46 26 26 33 64 33 24 37 54 38 53 21 30 18 34 32 31 27 28 34 29 47 27
## [51] 25 35 25 34 19 29 36 29 40 46 34 42 64 21 24 43 37 37 56 57 20 40 31 22 53
## [76] 55 42 29 30 53 34 34 60 35 27 31 35 36 24 54 20 41 19 28 41 26 30 51 37 33
## [101] 30 28 26 41 33 27 41 55 22 56 29 29 58 26 46 25 28 30 36 30 25 33 46 38 24
## [126] 23 45 37 24 34 19 21 26 22 31 25 20 56 53 27 30 36 32 45 43 56 21 59 34 26
## [151] 45 45 23 37 19 31 40 41 22 22 48 51 36 35 46 31 30 22 55 42 21 60 25 50 42
## [176] 40 43 33 60 52 53 30 37 32 44 32 38 44 36 38 56 32 25 37 36 29 48 36 55 42
## [201] 61 29 37 19 28 21 52 33 33 48 38 52 34 34 42 22 47 61 23 36 46 42 63 25 38
## [226] 28 38 50 21 28 64 26 33 23 23 34 52 32 41 61 45 22 20 50 38 25 52 24 36 37
## [251] 29 29 43 36 49 24 32 44 37 35 30 42 61 31 34 41 26 42 63 38 56 34 33 50 24
## [276] 47 25 27 62 30 26 22 46 19 21 32 57 42 55 26 43 26 35 23 50 43 33 35 18 37
## [301] 39 24 32 49 26 48 35 38 25 28 20 20 19 39 26 22 33 47 41 57 32 29 32 44 52
## [326] 27 58 36 29 54 37 64 21 51 32 40 38 33 53 25 63 27 20 26 39 32 64 37 43 47
## [351] 24 43 37 54 51 63 34 52 20 32 20 43 34 42 32 25 21 28 61 35 63 56 31 32 38
## [376] 25 27 24 23 20 42 42 33 25 34 20 38 44 53 59 45 23 36 39 28 20 61 22 18 44
## [401] 41 33 30 62 20 61 28 49 25 24 54 56 35 62 19 19 44 43 26 28 51 30 27 35 28
## [426] 59 61 27 53 53 39 54 28 35 48 32 29 26 36 27 30 54 27 18 35 36 28 30 36 28
## [451] 31 35 47 31 36 43 34 39 31 31 44 46 38 38 29 29 29 34 57 39 26 34 38 32 38
## [476] 51 22 51 21 36 20 57 60 42 26 64 39 24 33 38 42 36 50 32 27 26 61 49 26 55
## [501] 36 60 41 21 33 32 39 31 36 44 37 33 47 57 37 35 32 43 32 29 30 39 32 25 49
## [526] 32 31 30 28 29 51 48 31 55
## [1] 36.83
#Nhận xét: Sau khi tính trung bình của 534 phần tử thì chúng ta thấy số tuổi trung bình của mọi người là 36.83333
median(tuoi)## [1] 35
#Nhận xét: phần tử trung vị là 35 tuổi nghĩa là đây là giá trị nằm giữa của phần nhỏ hơn và lớn hơn
#Lập bảng tần số và vẽ đồ thị lương và tuổi
tuoi1 <- cut(tuoi, breaks = c(0, 20, 40,60), labels = c("0-20", "20-40", "40-60"), right = TRUE)
table(tuoi1)## tuoi1
## 0-20 20-40 40-60
## 28 325 158
#Nhận xét: Tuổi trong khoảng từ 20-40 chiếm tỷ lệ rất lớn 63,6%, trong độ tuổi 40-60 chiếm tỷ lệ vừa phải 30,92% và độ tuổi từ 0-20 chiếm tỷ lệ thấp 5,48%
luong1 <- cut(luong, breaks =c(3, 5, 7,10), labels = c("thấp", "trung bình", "cao"), right = TRUE)
luong1## [1] trung bình thấp trung bình thấp cao <NA>
## [7] thấp <NA> <NA> cao <NA> <NA>
## [13] trung bình trung bình <NA> cao cao <NA>
## [19] thấp <NA> trung bình trung bình thấp thấp
## [25] cao trung bình cao trung bình thấp thấp
## [31] cao thấp thấp thấp cao <NA>
## [37] cao cao cao <NA> thấp <NA>
## [43] <NA> thấp thấp trung bình <NA> thấp
## [49] cao trung bình cao <NA> thấp thấp
## [55] thấp trung bình cao trung bình cao thấp
## [61] trung bình <NA> trung bình <NA> thấp cao
## [67] <NA> <NA> trung bình trung bình thấp <NA>
## [73] trung bình thấp thấp <NA> thấp cao
## [79] thấp <NA> <NA> <NA> trung bình thấp
## [85] cao cao trung bình cao trung bình cao
## [91] trung bình cao <NA> thấp <NA> cao
## [97] cao <NA> cao <NA> <NA> cao
## [103] trung bình cao <NA> <NA> <NA> <NA>
## [109] <NA> <NA> <NA> <NA> <NA> trung bình
## [115] cao thấp thấp <NA> trung bình trung bình
## [121] trung bình thấp trung bình <NA> thấp trung bình
## [127] trung bình cao thấp thấp trung bình trung bình
## [133] <NA> trung bình thấp trung bình trung bình thấp
## [139] cao trung bình trung bình cao <NA> <NA>
## [145] cao cao thấp <NA> <NA> trung bình
## [151] thấp <NA> thấp cao trung bình cao
## [157] <NA> <NA> trung bình thấp <NA> <NA>
## [163] <NA> cao <NA> thấp <NA> thấp
## [169] <NA> trung bình <NA> <NA> <NA> trung bình
## [175] cao <NA> <NA> <NA> thấp <NA>
## [181] <NA> trung bình <NA> <NA> <NA> <NA>
## [187] trung bình <NA> <NA> <NA> <NA> trung bình
## [193] thấp cao cao cao cao trung bình
## [199] <NA> <NA> cao cao <NA> cao
## [205] <NA> thấp <NA> <NA> cao <NA>
## [211] <NA> thấp cao <NA> <NA> cao
## [217] thấp <NA> trung bình thấp <NA> thấp
## [223] trung bình trung bình cao trung bình <NA> thấp
## [229] thấp thấp <NA> thấp thấp trung bình
## [235] trung bình thấp <NA> thấp <NA> <NA>
## [241] cao thấp thấp cao trung bình thấp
## [247] thấp trung bình <NA> thấp cao cao
## [253] cao cao cao trung bình <NA> cao
## [259] trung bình cao thấp trung bình <NA> <NA>
## [265] cao trung bình thấp cao trung bình cao
## [271] cao trung bình trung bình <NA> trung bình <NA>
## [277] thấp cao cao cao thấp thấp
## [283] <NA> thấp cao <NA> thấp <NA>
## [289] <NA> trung bình thấp trung bình <NA> <NA>
## [295] trung bình cao thấp <NA> thấp cao
## [301] trung bình trung bình <NA> trung bình cao cao
## [307] cao cao thấp trung bình thấp cao
## [313] thấp cao trung bình thấp cao <NA>
## [319] cao cao cao trung bình <NA> thấp
## [325] trung bình <NA> <NA> trung bình trung bình thấp
## [331] trung bình <NA> trung bình trung bình thấp trung bình
## [337] thấp trung bình thấp thấp <NA> cao
## [343] thấp cao cao cao trung bình cao
## [349] thấp trung bình thấp cao thấp <NA>
## [355] thấp thấp thấp trung bình thấp <NA>
## [361] thấp thấp cao thấp cao thấp
## [367] thấp trung bình thấp cao thấp thấp
## [373] trung bình thấp cao trung bình cao thấp
## [379] <NA> thấp cao cao cao thấp
## [385] thấp thấp trung bình trung bình thấp thấp
## [391] thấp cao <NA> <NA> trung bình trung bình
## [397] cao trung bình thấp trung bình cao cao
## [403] trung bình trung bình cao cao cao thấp
## [409] trung bình <NA> trung bình trung bình thấp thấp
## [415] thấp <NA> thấp <NA> thấp cao
## [421] <NA> thấp thấp <NA> cao thấp
## [427] cao thấp cao cao <NA> <NA>
## [433] <NA> <NA> cao <NA> <NA> trung bình
## [439] cao cao <NA> <NA> trung bình cao
## [445] <NA> <NA> cao cao cao <NA>
## [451] <NA> <NA> <NA> <NA> trung bình <NA>
## [457] cao <NA> trung bình <NA> cao <NA>
## [463] trung bình <NA> trung bình trung bình <NA> cao
## [469] cao trung bình <NA> cao <NA> trung bình
## [475] trung bình trung bình thấp trung bình trung bình <NA>
## [481] thấp trung bình <NA> <NA> <NA> <NA>
## [487] <NA> cao <NA> <NA> cao <NA>
## [493] <NA> cao <NA> <NA> <NA> <NA>
## [499] cao <NA> <NA> trung bình <NA> thấp
## [505] <NA> trung bình cao <NA> <NA> cao
## [511] cao <NA> <NA> <NA> <NA> cao
## [517] <NA> cao trung bình trung bình cao <NA>
## [523] cao trung bình trung bình cao <NA> <NA>
## [529] <NA> <NA> trung bình <NA> <NA> <NA>
## Levels: thấp trung bình cao
barplot(tuoi, xlab = " ", ylab = "Tuổi", main = "Biểu đồ thể hiện dữ liệu của biến tuổi ", col = c("red", "green", "blue", "pink", "white"))barplot(luong, xlab = " ", ylab = "Lương", main = "Biểu đồ thể hiện dữ liệu của biến lương ", col = c("red", "green", "blue", "pink", "white"))## luong1
## tuoi thấp trung bình cao
## 18 3 0 1
## 19 4 3 1
## 20 9 3 2
## 21 5 3 2
## 22 8 3 1
## 23 1 4 1
## 24 6 5 1
## 25 9 6 1
## 26 6 7 5
## 27 4 3 6
## 28 3 5 5
## 29 1 7 5
## 30 3 4 4
## 31 4 3 2
## 32 3 4 6
## 33 5 2 5
## 34 5 3 6
## 35 2 2 6
## 36 1 4 7
## 37 2 2 8
## 38 1 5 5
## 39 0 2 3
## 40 0 1 1
## 41 0 2 5
## 42 3 2 5
## 43 4 0 6
## 44 2 2 3
## 45 2 2 1
## 46 1 2 1
## 47 1 1 1
## 48 0 0 3
## 49 1 2 1
## 50 1 2 1
## 51 1 4 0
## 52 2 2 0
## 53 3 0 4
## 54 1 1 1
## 55 0 1 1
## 56 2 2 2
## 57 2 3 3
## 58 0 0 0
## 59 2 0 0
## 60 1 2 0
## 61 1 0 4
## 62 1 1 1
## 63 2 2 0
## 64 1 2 0
##Kiểm định Chi Bình Phương giữa 2 biến
#chúng ta có thể sử dụng kiểm định H0 và H1 với alpha bằng 0.5 để kiểm ra giá trị p- value xem nó có thể thỏa mãn đươc đề bài không
chisq.test(luong, tuoi, correct=FALSE)
#Với alpha bằng 5%, p-value =0.729> alpha bằng 5%. Ta có thể kết luận là 2 biến này độc lập với nhau
#Lương theo giới tính f1 = table(luong,gioitinh) f1
#Sử dụng Chi bình phương để xác định sự phụ thuộc của 2 biến
chisq.test(luong, gioitinh, correct=FALSE)
data: luong and gioitinh X-squared = 270.1, df = 237, p-value = 0.06876
Nhận xét: với p-value=0.06876> alpha =5% bác bỏ H0, Kết luận lương ảnh hưởng đến giới tính.
Dữ liệu chéo bắt nguồn từ Khảo sát dân số hiện tại tháng 5 năm 1985 của cục Điều tra dân số Hoa Kỳ (mẫu ngẫu nhiên rút ra cho Berndt 1991).
Wage: Lương (tính bằng đô la mỗi giờ)
Education: Trình độ học vấn
Experience: Số năm kinh nghiệm làm việc
Age: tuổi tính bằng năm
ethnicity: Yếu tố dân tộc với các cấp độ "cauc", "hispanic", "other".
Region Factor (khu vực sinh sống): có sống ở Miền Nam hay không?
gender: yếu tố chỉ giới tính
Occupation factor: Yếu tố nghề nghiệp với các mức độ "công nhân" (thợ hoặc công nhân dây chuyền lắp ráp), "kỹ thuật" , (nhân viên phục vụ), văn phòng và nhân viên văn thư,(nhân viên bán hàng), (quản lý và điều hành).
Sector : Yếu tố với các cấp độ "chế tạo" (chế tạo hoặc khai khoáng), "xây dựng", "khác".
union Factor: Cá nhân có làm công việc đoàn thể không?
married Factor: Cá nhân đã kết hôn chưa?
Phân tích dữ liệu SPS1985 từ package "AER" để có dữ liệu chúng ta vào library() để tìm dữ liệu của package AER sau đó thì tìm dataset (CPS1985)
```r
library(AER) ##Lấy dữ liệu dataset CPS1985 từ package AER để tiến hành phân tích
data("CPS1985")
h <- CPS1985 #Gán dữ liệu CPS1985 cho h
str(h) #xem cấu trúc dữ liệu gốc
## 'data.frame': 534 obs. of 11 variables:
## $ wage : num 5.1 4.95 6.67 4 7.5 ...
## $ education : num 8 9 12 12 12 13 10 12 16 12 ...
## $ experience: num 21 42 1 4 17 9 27 9 11 9 ...
## $ age : num 35 57 19 22 35 28 43 27 33 27 ...
## $ ethnicity : Factor w/ 3 levels "cauc","hispanic",..: 2 1 1 1 1 1 1 1 1 1 ...
## $ region : Factor w/ 2 levels "south","other": 2 2 2 2 2 2 1 2 2 2 ...
## $ gender : Factor w/ 2 levels "male","female": 2 2 1 1 1 1 1 1 1 1 ...
## $ occupation: Factor w/ 6 levels "worker","technical",..: 1 1 1 1 1 1 1 1 1 1 ...
## $ sector : Factor w/ 3 levels "manufacturing",..: 1 1 1 3 3 3 3 3 1 3 ...
## $ union : Factor w/ 2 levels "no","yes": 1 1 1 1 1 2 1 1 1 1 ...
## $ married : Factor w/ 2 levels "no","yes": 2 2 1 1 2 1 1 1 2 1 ...
## wage education experience age ethnicity region gender occupation
## 1 5.10 8 21 35 hispanic other female worker
## 1100 4.95 9 42 57 cauc other female worker
## 2 6.67 12 1 19 cauc other male worker
## 3 4.00 12 4 22 cauc other male worker
## 4 7.50 12 17 35 cauc other male worker
## 5 13.07 13 9 28 cauc other male worker
## sector union married
## 1 manufacturing no yes
## 1100 manufacturing no yes
## 2 manufacturing no no
## 3 other no no
## 4 other no yes
## 5 other yes no
#Xuất hiện 6 dòng cuối của cáy trúc
## wage education experience age ethnicity region gender occupation
## 528 11.79 16 6 28 cauc other female technical
## 529 11.36 18 5 29 cauc other male technical
## 530 6.10 12 33 51 other other female technical
## 531 23.25 17 25 48 other other female technical
## 532 19.88 12 13 31 cauc south male technical
## 533 15.38 16 33 55 cauc other male technical
## sector union married
## 528 other yes no
## 529 other no no
## 530 other no yes
## 531 other yes yes
## 532 other yes yes
## 533 manufacturing no yes
th <- h[gioitinh ==“male” & hocvan == “12”,] th #Nhận xét: Sau khi lọc dữ liệu thì tìm thấy có 109 người có giới tính nam và thỏa điều kiện học lớp 12 chiếm 20,41%
#Lập bảng tần số của biến trình độ học vấn theo độ tuổi
#Sử dụng dữ liệu trong package “ggplot2” cho biến giới tuổi và trình độ học vấn
library(ggplot2)
barplot(hocvan, xlab = " ", ylab = "học vấn", main = "Biểu đồ thể hiện dữ liệu của biến học vấn ", col = c("red", "green", "blue", "pink", "white"))barplot(Tuoi, xlab = "", ylab = "Tuổi", main = "Biểu đồ thể hiện dữ liệu của biến Tuổi", col = c("red", "green", "blue", "pink", "white"))##Xử lý dữ liệu ## Lọc dữ liệu:
## [1] 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11
## [26] 11 11
#Sắp xếp dữ liệu theo trình độ chuyên môn tăng dần
## wage education experience age ethnicity region gender occupation
## 1 5.10 8 21 35 hispanic other female worker
## 1100 4.95 9 42 57 cauc other female worker
## 2 6.67 12 1 19 cauc other male worker
## 3 4.00 12 4 22 cauc other male worker
## 4 7.50 12 17 35 cauc other male worker
## 5 13.07 13 9 28 cauc other male worker
## 6 4.45 10 27 43 cauc south male worker
## 7 19.47 12 9 27 cauc other male worker
## 8 13.28 16 11 33 cauc other male worker
## 9 8.75 12 9 27 cauc other male worker
## 10 11.35 12 17 35 cauc other male worker
## 11 11.50 12 19 37 cauc other male worker
## 12 6.50 8 27 41 cauc south male worker
## 13 6.25 9 30 45 cauc south male worker
## 14 19.98 9 29 44 cauc south male worker
## 15 7.30 12 37 55 cauc other male worker
## 16 8.00 7 44 57 cauc south male worker
## 17 22.20 12 26 44 cauc other male worker
## 18 3.65 11 16 33 cauc other male worker
## 19 20.55 12 33 51 cauc other male worker
## 20 5.71 12 16 34 cauc other female worker
## 21 7.00 7 42 55 other other male worker
## 22 3.75 12 9 27 cauc other male worker
## 23 4.50 11 14 31 other south male worker
## 24 9.56 12 23 41 cauc other male worker
## 25 5.75 6 45 57 cauc south male worker
## 26 9.36 12 8 26 cauc other male worker
## 27 6.50 10 30 46 cauc other male worker
## 28 3.35 12 8 26 cauc other female worker
## 29 4.75 12 8 26 cauc other male worker
## 30 8.90 14 13 33 cauc other male worker
## 31 4.00 12 46 64 cauc south female worker
## 32 4.70 8 19 33 cauc other male worker
## 33 5.00 17 1 24 cauc south female worker
## 34 9.25 12 19 37 cauc other male worker
## 35 10.67 12 36 54 other other male worker
## 36 7.61 12 20 38 other south male worker
## 37 10.00 12 35 53 other other male worker
## 38 7.50 12 3 21 cauc other male worker
## 39 12.20 14 10 30 cauc south male worker
## 40 3.35 12 0 18 cauc other male worker
## 41 11.00 14 14 34 cauc south male worker
## 42 12.00 12 14 32 cauc other male worker
## 43 4.85 9 16 31 cauc other female worker
## 44 4.30 13 8 27 cauc south male worker
## 45 6.00 7 15 28 cauc south female worker
## 46 15.00 16 12 34 cauc other male worker
## 47 4.85 10 13 29 cauc south male worker
## 48 9.00 8 33 47 cauc other male worker
## 49 6.36 12 9 27 cauc other male worker
## 50 9.15 12 7 25 cauc other male worker
## 51 11.00 16 13 35 cauc other male worker
## 52 4.50 12 7 25 cauc other female worker
## 53 4.80 12 16 34 cauc other female worker
## 54 4.00 13 0 19 cauc other male worker
## 55 5.50 12 11 29 cauc other female worker
## 56 8.40 13 17 36 cauc other male worker
## 57 6.75 10 13 29 cauc other male worker
## 58 10.00 12 22 40 other other male worker
## 59 5.00 12 28 46 cauc other female worker
## 60 6.50 11 17 34 cauc other male worker
## 61 10.75 12 24 42 cauc other male worker
## 62 7.00 3 55 64 hispanic south male worker
## 63 11.43 12 3 21 cauc south male worker
## 64 4.00 12 6 24 other other male worker
## 65 9.00 10 27 43 cauc other male worker
## 66 13.00 12 19 37 other south male worker
## 67 12.22 12 19 37 cauc other male worker
## 68 6.28 12 38 56 cauc other female worker
## 69 6.75 10 41 57 other south male worker
## 70 3.35 11 3 20 other south male worker
## 71 16.00 14 20 40 cauc other male worker
## 72 5.25 10 15 31 cauc other male worker
## 73 3.50 8 8 22 hispanic south male worker
## 74 4.22 8 39 53 cauc south female worker
## 75 3.00 6 43 55 hispanic other female worker
## 76 4.00 11 25 42 cauc south female worker
## 77 10.00 12 11 29 cauc other male worker
## 78 5.00 12 12 30 other other male worker
## 79 16.00 12 35 53 cauc south male worker
## 80 13.98 14 14 34 cauc other male worker
## 81 13.26 12 16 34 cauc other male worker
## 82 6.10 10 44 60 cauc other female worker
## 83 3.75 16 13 35 cauc south female worker
## 84 9.00 13 8 27 other other male worker
## 85 9.45 12 13 31 cauc other male worker
## 86 5.50 11 18 35 cauc other male worker
## 87 8.93 12 18 36 cauc other female worker
## 88 6.25 12 6 24 cauc south female worker
## 89 9.75 11 37 54 cauc south male worker
## 90 6.73 12 2 20 cauc south male worker
## 91 7.78 12 23 41 cauc other male worker
## 92 2.85 12 1 19 cauc other male worker
## 93 3.35 12 10 28 other south female worker
## 94 19.98 12 23 41 cauc other male worker
## 95 8.50 12 8 26 other other male worker
## 96 9.75 15 9 30 cauc other female worker
## 97 15.00 12 33 51 cauc other male worker
## 98 8.00 12 19 37 cauc other female worker
## 99 11.25 13 14 33 cauc other male worker
## 100 14.00 11 13 30 cauc other male worker
## 101 10.00 10 12 28 cauc other male worker
## 102 6.50 12 8 26 cauc other male worker
## 103 9.83 12 23 41 cauc other male worker
## 104 18.50 14 13 33 cauc other female worker
## 105 12.50 12 9 27 cauc south male worker
## 106 26.00 14 21 41 cauc other male worker
## 107 14.00 5 44 55 cauc south male worker
## 108 10.50 12 4 22 cauc other male worker
## 109 11.00 8 42 56 cauc other male worker
## 110 12.47 13 10 29 cauc other male worker
## 111 12.50 12 11 29 cauc other male worker
## 112 15.00 12 40 58 cauc other male worker
## 113 6.00 12 8 26 cauc other male worker
## 114 9.50 11 29 46 cauc south male worker
## 115 5.00 16 3 25 cauc other male worker
## 116 3.75 11 11 28 cauc other male worker
## 117 12.57 12 12 30 cauc other male worker
## 118 6.88 8 22 36 hispanic other female worker
## 119 5.50 12 12 30 cauc other male worker
## 120 7.00 12 7 25 cauc other male worker
## 121 4.50 12 15 33 cauc other female worker
## 122 6.50 12 28 46 cauc other male worker
## 123 12.00 12 20 38 cauc south male worker
## 124 5.00 12 6 24 cauc south male worker
## 125 6.50 12 5 23 cauc south male worker
## 126 6.80 9 30 45 cauc south female worker
## 127 8.75 13 18 37 cauc other male worker
## 128 3.75 12 6 24 other south female worker
## 129 4.50 12 16 34 hispanic south male worker
## 130 6.00 12 1 19 hispanic south male worker
## 131 5.50 12 3 21 cauc other male worker
## 132 13.00 12 8 26 cauc other male worker
## 133 5.65 14 2 22 cauc other male worker
## 134 4.80 9 16 31 other other male worker
## 135 7.00 10 9 25 cauc south male worker
## 136 5.25 12 2 20 cauc other male worker
## 137 3.35 7 43 56 cauc south male worker
## 138 8.50 9 38 53 cauc other male worker
## 139 6.00 12 9 27 cauc other male worker
## 140 6.75 12 12 30 cauc south male worker
## 141 8.89 12 18 36 cauc other male worker
## 142 14.21 11 15 32 cauc other male worker
## 143 10.78 11 28 45 other south male worker
## 144 8.90 10 27 43 cauc south male worker
## 145 7.50 12 38 56 cauc south male worker
## 146 4.50 12 3 21 cauc other female worker
## 147 11.25 12 41 59 cauc other male worker
## 148 13.45 12 16 34 cauc south male worker
## 149 6.00 13 7 26 cauc south male worker
## 150 4.62 6 33 45 other south female worker
## 151 10.58 14 25 45 cauc other male worker
## 152 5.00 12 5 23 cauc south male worker
## 153 8.20 14 17 37 other south male worker
## 154 6.25 12 1 19 cauc south male worker
## 155 8.50 12 13 31 cauc other male worker
## 429 10.00 13 34 53 cauc other male technical
## 430 18.00 18 15 39 cauc other male technical
## 431 24.98 17 31 54 cauc other male technical
## 432 12.05 16 6 28 cauc other female technical
## 433 22.00 14 15 35 cauc south male technical
## 434 8.75 12 30 48 cauc other male technical
## 435 22.20 18 8 32 cauc other male technical
## 436 17.25 18 5 29 cauc other male technical
## 437 6.00 17 3 26 cauc other female technical
## 438 8.06 13 17 36 cauc south male technical
## 439 9.24 16 5 27 other other male technical
## 440 12.00 14 10 30 cauc other female technical
## 441 10.61 15 33 54 cauc other female technical
## 442 5.71 18 3 27 cauc other male technical
## 443 10.00 16 0 18 cauc other female technical
## 444 17.50 16 13 35 other south male technical
## 445 15.00 18 12 36 cauc other male technical
## 446 7.78 16 6 28 cauc other female technical
## 447 7.80 17 7 30 cauc other male technical
## 448 10.00 16 14 36 cauc south male technical
## 449 24.98 17 5 28 cauc other female technical
## 450 10.28 15 10 31 cauc south female technical
## 451 15.00 18 11 35 cauc other female technical
## 452 12.00 17 24 47 cauc other female technical
## 453 10.58 16 9 31 cauc other male technical
## 454 5.85 18 12 36 cauc south male technical
## 455 11.22 18 19 43 cauc other male technical
## 456 8.56 14 14 34 cauc other female technical
## 457 13.89 16 17 39 cauc other female technical
## 458 5.71 18 7 31 cauc south male technical
## 459 15.79 18 7 31 cauc other male technical
## 460 7.50 16 22 44 cauc other female technical
## 461 11.25 12 28 46 cauc other female technical
## 462 6.15 16 16 38 cauc other female technical
## 463 13.45 16 16 38 other south male technical
## 464 6.25 16 7 29 cauc other female technical
## 465 6.50 12 11 29 cauc other female technical
## 466 12.00 12 11 29 cauc other female technical
## 467 8.50 12 16 34 cauc other female technical
## 468 8.00 18 33 57 cauc other male technical
## 469 5.75 12 21 39 cauc south female technical
## 470 15.73 16 4 26 cauc other male technical
## 471 9.86 15 13 34 cauc other male technical
## 472 13.51 18 14 38 cauc other male technical
## 473 5.40 16 10 32 cauc other female technical
## 474 6.25 18 14 38 cauc south male technical
## 475 5.50 16 29 51 cauc south male technical
## 476 5.00 12 4 22 hispanic other male technical
## 477 6.25 18 27 51 other other male technical
## 478 5.75 12 3 21 cauc other male technical
## 479 20.50 16 14 36 cauc south male technical
## 480 5.00 14 0 20 cauc other male technical
## 481 7.00 18 33 57 cauc other male technical
## 482 18.00 16 38 60 cauc south male technical
## 483 12.00 18 18 42 cauc other female technical
## 484 20.40 17 3 26 cauc other male technical
## 485 22.20 18 40 64 cauc other female technical
## 486 16.42 14 19 39 cauc other male technical
## 487 8.63 14 4 24 cauc other female technical
## 488 19.38 16 11 33 cauc other female technical
## 489 14.00 16 16 38 cauc other female technical
## 490 10.00 14 22 42 cauc other male technical
## 491 15.95 17 13 36 cauc other female technical
## 492 20.00 16 28 50 cauc south female technical
## 493 10.00 16 10 32 cauc other female technical
## 494 24.98 16 5 27 cauc south female technical
## 495 11.25 15 5 26 cauc other male technical
## 496 22.83 18 37 61 cauc other female technical
## 497 10.20 17 26 49 cauc other female technical
## 498 10.00 16 4 26 cauc south female technical
## 499 14.00 18 31 55 cauc other female technical
## 500 12.50 17 13 36 cauc other female technical
## 501 5.79 12 42 60 cauc other female technical
## 502 24.98 17 18 41 hispanic other male technical
## 503 4.35 12 3 21 cauc other female technical
## 504 11.25 17 10 33 cauc other female technical
## 505 6.67 16 10 32 cauc other female technical
## 506 8.00 16 17 39 hispanic other female technical
## 507 18.16 18 7 31 cauc other male technical
## 508 12.00 16 14 36 cauc other female technical
## 509 8.89 16 22 44 cauc other female technical
## 510 9.50 17 14 37 cauc other female technical
## 511 13.65 16 11 33 cauc other male technical
## 512 12.00 18 23 47 cauc other male technical
## 513 15.00 12 39 57 cauc other male technical
## 514 12.67 16 15 37 cauc other male technical
## 515 7.38 14 15 35 hispanic other female technical
## 516 15.56 16 10 32 cauc other male technical
## 517 7.45 12 25 43 cauc south female technical
## 518 6.25 14 12 32 cauc other female technical
## 519 6.25 16 7 29 hispanic south female technical
## 520 9.37 17 7 30 cauc other male technical
## 521 22.50 16 17 39 cauc other male technical
## 522 7.50 16 10 32 cauc other male technical
## 523 7.00 17 2 25 cauc south male technical
## 524 5.75 9 34 49 other south female technical
## 525 7.67 15 11 32 cauc other female technical
## 526 12.50 15 10 31 cauc other male technical
## 527 16.00 12 12 30 cauc south male technical
## 528 11.79 16 6 28 cauc other female technical
## 529 11.36 18 5 29 cauc other male technical
## 530 6.10 12 33 51 other other female technical
## 531 23.25 17 25 48 other other female technical
## 532 19.88 12 13 31 cauc south male technical
## 533 15.38 16 33 55 cauc other male technical
## 346 6.00 4 54 64 cauc other male services
## 347 7.14 14 17 37 cauc other male services
## 348 3.40 8 29 43 other other female services
## 349 6.00 15 26 47 cauc south female services
## 350 3.75 2 16 24 hispanic other male services
## 351 8.89 8 29 43 other other female services
## 352 4.35 11 20 37 cauc other female services
## 353 13.10 10 38 54 other south female services
## 354 4.35 8 37 51 other south female services
## 355 3.50 9 48 63 cauc other male services
## 356 3.80 12 16 34 cauc other female services
## 357 5.26 8 38 52 cauc other female services
## 358 3.35 14 0 20 other other male services
## 359 16.26 12 14 32 other other male services
## 360 4.25 12 2 20 cauc other female services
## 361 4.50 16 21 43 cauc other male services
## 362 8.00 13 15 34 cauc other female services
## 363 4.00 16 20 42 cauc other female services
## 364 7.96 14 12 32 cauc other female services
## 365 4.00 12 7 25 hispanic south male services
## 366 4.15 11 4 21 cauc other male services
## 367 5.95 13 9 28 cauc south male services
## 368 3.60 12 43 61 hispanic south female services
## 369 8.75 10 19 35 cauc south male services
## 370 3.40 8 49 63 cauc other female services
## 371 4.28 12 38 56 cauc other female services
## 372 5.35 12 13 31 cauc other female services
## 373 5.00 12 14 32 cauc other female services
## 374 7.65 12 20 38 cauc other male services
## 375 6.94 12 7 25 cauc other female services
## 376 7.50 12 9 27 cauc other female services
## 377 3.60 12 6 24 cauc other female services
## 378 1.75 12 5 23 cauc south female services
## 379 3.45 13 1 20 other south female services
## 380 9.63 14 22 42 cauc other male services
## 381 8.49 12 24 42 cauc other female services
## 382 8.99 12 15 33 cauc other female services
## 383 3.65 11 8 25 cauc south female services
## 384 3.50 11 17 34 cauc south female services
## 385 3.43 12 2 20 other south male services
## 386 5.50 12 20 38 cauc south male services
## 387 6.93 12 26 44 cauc other male services
## 388 3.51 10 37 53 other south female services
## 389 3.75 12 41 59 cauc other female services
## 390 4.17 12 27 45 cauc other female services
## 391 9.57 12 5 23 cauc other female services
## 392 14.67 14 16 36 other other male services
## 393 12.50 14 19 39 cauc other female services
## 394 5.50 12 10 28 cauc other male services
## 395 5.15 13 1 20 cauc south male services
## 396 8.00 12 43 61 other other female services
## 397 5.83 13 3 22 other other male services
## 398 3.35 12 0 18 cauc other female services
## 399 7.00 12 26 44 cauc south female services
## 400 10.00 10 25 41 cauc other female services
## 401 8.00 12 15 33 cauc other female services
## 402 6.88 14 10 30 cauc south female services
## 403 5.55 11 45 62 cauc other female services
## 404 7.50 11 3 20 other other male services
## 405 8.93 8 47 61 hispanic other male services
## 406 9.00 16 6 28 other other female services
## 407 3.50 10 33 49 cauc south female services
## 408 5.77 16 3 25 cauc other male services
## 409 25.00 14 4 24 hispanic other male services
## 410 6.85 14 34 54 other other male services
## 411 6.50 11 39 56 cauc south male services
## 412 3.75 12 17 35 cauc south female services
## 413 3.50 9 47 62 cauc other male services
## 414 4.50 11 2 19 cauc other male services
## 415 2.01 13 0 19 cauc south male services
## 416 4.17 14 24 44 cauc other female services
## 417 13.00 12 25 43 other other male services
## 418 3.98 14 6 26 cauc other female services
## 419 7.50 12 10 28 cauc other female services
## 420 13.12 12 33 51 other other female services
## 421 4.00 12 12 30 cauc other male services
## 422 3.95 12 9 27 cauc south female services
## 423 13.00 11 18 35 cauc south male services
## 424 9.00 12 10 28 cauc other male services
## 425 4.55 8 45 59 cauc south female services
## 426 9.50 9 46 61 cauc other female services
## 427 4.50 7 14 27 hispanic south male services
## 428 8.75 11 36 53 cauc other female services
## 249 5.00 14 17 37 hispanic other female office
## 250 8.75 13 10 29 cauc south female office
## 251 10.00 16 7 29 cauc other female office
## 252 8.50 12 25 43 cauc other female office
## 253 8.63 12 18 36 other other female office
## 254 9.00 16 27 49 cauc other female office
## 255 5.50 16 2 24 cauc other female office
## 256 11.11 13 13 32 cauc other male office
## 257 10.00 14 24 44 cauc other female office
## 258 5.20 18 13 37 hispanic south female office
## 259 8.00 14 15 35 cauc other female office
## 260 3.56 12 12 30 hispanic south female office
## 261 5.20 12 24 42 cauc other female office
## 262 11.67 12 43 61 cauc other female office
## 263 11.32 12 13 31 cauc other female office
## 264 7.50 12 16 34 cauc south female office
## 265 5.50 11 24 41 cauc other female office
## 266 5.00 16 4 26 cauc south female office
## 267 7.75 12 24 42 cauc other female office
## 268 5.25 12 45 63 cauc other female office
## 269 9.00 12 20 38 cauc other male office
## 270 9.65 12 38 56 cauc other female office
## 271 5.21 18 10 34 cauc south male office
## 272 7.00 11 16 33 other other female office
## 273 12.16 12 32 50 other south female office
## 274 5.25 16 2 24 cauc south female office
## 275 10.32 13 28 47 cauc south female office
## 276 3.35 16 3 25 other other male office
## 277 7.70 13 8 27 cauc other female office
## 278 9.17 12 44 62 cauc other female office
## 279 8.43 12 12 30 cauc south male office
## 280 4.00 12 8 26 other south male office
## 281 4.13 12 4 22 cauc other female office
## 282 3.00 12 28 46 cauc south female office
## 283 4.25 13 0 19 cauc south female office
## 284 7.53 14 1 21 cauc south male office
## 285 10.53 14 12 32 cauc other female office
## 286 5.00 12 39 57 cauc other female office
## 287 15.03 12 24 42 cauc other female office
## 288 11.25 17 32 55 other other female office
## 289 6.25 16 4 26 other other male office
## 290 3.50 12 25 43 other other female office
## 291 6.85 12 8 26 other other male office
## 292 12.50 13 16 35 cauc other female office
## 293 12.00 12 5 23 cauc south male office
## 294 6.00 13 31 50 cauc other male office
## 295 9.50 12 25 43 cauc other female office
## 296 4.10 12 15 33 cauc other female office
## 297 10.43 14 15 35 cauc south female office
## 298 5.00 12 0 18 cauc other female office
## 299 7.69 12 19 37 cauc other male office
## 300 5.50 12 21 39 other other female office
## 301 6.40 12 6 24 cauc other female office
## 302 12.50 12 14 32 cauc other female office
## 303 6.25 13 30 49 cauc other female office
## 304 8.00 12 8 26 cauc other female office
## 305 9.60 9 33 48 cauc other male office
## 306 9.10 13 16 35 hispanic other male office
## 307 7.50 12 20 38 cauc south female office
## 308 5.00 13 6 25 cauc south female office
## 309 7.00 12 10 28 cauc other female office
## 310 3.55 13 1 20 cauc south female office
## 311 8.50 12 2 20 other south male office
## 312 4.50 13 0 19 cauc south female office
## 313 7.88 16 17 39 other other male office
## 314 5.25 12 8 26 cauc other female office
## 315 5.00 12 4 22 cauc south male office
## 316 9.33 12 15 33 cauc other female office
## 317 10.50 12 29 47 cauc other female office
## 318 7.50 12 23 41 other south female office
## 319 9.50 12 39 57 cauc south female office
## 320 9.60 12 14 32 cauc south female office
## 321 5.87 17 6 29 other south female office
## 322 11.02 14 12 32 cauc south male office
## 323 5.00 12 26 44 cauc south female office
## 324 5.62 14 32 52 cauc other female office
## 325 12.50 15 6 27 cauc other female office
## 326 10.81 12 40 58 cauc other female office
## 327 5.40 12 18 36 cauc other female office
## 328 7.00 11 12 29 cauc other female office
## 329 4.59 12 36 54 cauc south female office
## 330 6.00 12 19 37 cauc other female office
## 331 11.71 16 42 64 cauc other female office
## 332 5.62 13 2 21 hispanic other female office
## 333 5.50 12 33 51 cauc other female office
## 334 4.85 12 14 32 cauc south female office
## 335 6.75 12 22 40 cauc other male office
## 336 4.25 12 20 38 cauc other female office
## 337 5.75 12 15 33 cauc other female office
## 338 3.50 12 35 53 cauc other male office
## 339 3.35 12 7 25 cauc other female office
## 340 10.62 12 45 63 cauc other female office
## 341 8.00 12 9 27 cauc other female office
## 342 4.75 12 2 20 cauc south female office
## 343 8.50 17 3 26 cauc south male office
## 344 8.85 14 19 39 other other female office
## 345 8.00 12 14 32 cauc south female office
## 211 4.55 13 33 52 cauc other female sales
## 212 9.00 12 16 34 cauc other male sales
## 213 13.33 18 10 34 cauc other male sales
## 214 15.00 14 22 42 cauc other male sales
## 215 7.50 14 2 22 cauc other male sales
## 216 4.25 12 29 47 cauc south female sales
## 217 12.50 12 43 61 cauc other male sales
## 218 5.13 12 5 23 cauc other female sales
## 219 3.35 16 14 36 other south female sales
## 220 11.11 12 28 46 cauc south male sales
## 221 3.84 11 25 42 other south female sales
## 222 6.40 12 45 63 cauc other female sales
## 223 5.56 14 5 25 cauc south male sales
## 224 10.00 12 20 38 cauc south male sales
## 225 5.65 16 6 28 cauc other female sales
## 226 11.50 16 16 38 cauc other male sales
## 227 3.50 11 33 50 cauc other female sales
## 228 3.35 13 2 21 cauc south female sales
## 229 4.75 12 10 28 cauc south female sales
## 230 19.98 14 44 64 cauc south male sales
## 231 3.50 14 6 26 cauc south female sales
## 232 4.00 12 15 33 cauc other female sales
## 233 7.00 12 5 23 cauc other male sales
## 234 6.25 13 4 23 cauc other female sales
## 235 4.50 14 14 34 cauc other male sales
## 236 14.29 14 32 52 cauc other female sales
## 237 5.00 12 14 32 cauc other female sales
## 238 13.75 14 21 41 cauc other male sales
## 239 13.71 12 43 61 cauc other male sales
## 240 7.50 12 27 45 other south female sales
## 241 3.80 12 4 22 cauc other female sales
## 242 5.00 14 0 20 hispanic other male sales
## 243 9.42 12 32 50 cauc south male sales
## 244 5.50 12 20 38 cauc other male sales
## 245 3.75 15 4 25 cauc south male sales
## 246 3.50 12 34 52 cauc other male sales
## 247 5.80 13 5 24 cauc other male sales
## 248 12.00 17 13 36 cauc other male sales
## 156 24.98 16 18 40 cauc other male management
## 157 16.65 14 21 41 cauc south male management
## 158 6.25 14 2 22 cauc other male management
## 159 4.55 12 4 22 hispanic south female management
## 160 11.25 12 30 48 hispanic south female management
## 161 21.25 13 32 51 cauc other male management
## 162 12.65 17 13 36 cauc other female management
## 163 7.50 12 17 35 cauc other male management
## 164 10.25 14 26 46 cauc other female management
## 165 3.35 16 9 31 cauc other male management
## 166 13.45 16 8 30 other other male management
## 167 4.84 15 1 22 cauc other male management
## 168 26.29 17 32 55 cauc south male management
## 169 6.58 12 24 42 cauc other female management
## 170 44.50 14 1 21 cauc other female management
## 171 15.00 12 42 60 cauc other male management
## 172 11.25 16 3 25 other other female management
## 173 7.00 12 32 50 cauc other female management
## 174 10.00 14 22 42 other other male management
## 175 14.53 16 18 40 cauc other male management
## 176 20.00 18 19 43 cauc other female management
## 177 22.50 15 12 33 cauc other male management
## 178 3.64 12 42 60 cauc other female management
## 179 10.62 12 34 52 cauc south male management
## 180 24.98 18 29 53 cauc other male management
## 181 6.00 16 8 30 cauc south male management
## 182 19.00 18 13 37 cauc other male management
## 183 13.20 16 10 32 cauc other male management
## 184 22.50 16 22 44 cauc other male management
## 185 15.00 16 10 32 cauc south male management
## 186 6.88 17 15 38 cauc other female management
## 187 11.84 12 26 44 cauc other male management
## 188 16.14 14 16 36 cauc other male management
## 189 13.95 18 14 38 cauc other female management
## 190 13.16 12 38 56 cauc other female management
## 191 5.30 12 14 32 other south male management
## 192 4.50 12 7 25 cauc other female management
## 193 10.00 18 13 37 cauc south female management
## 194 10.00 10 20 36 cauc other male management
## 195 10.00 16 7 29 hispanic other male management
## 196 9.37 16 26 48 cauc other female management
## 197 5.80 16 14 36 cauc other male management
## 198 17.86 13 36 55 cauc other male management
## 199 1.00 12 24 42 cauc other male management
## 200 8.80 14 41 61 cauc south male management
## 201 9.00 16 7 29 other other male management
## 202 18.16 17 14 37 cauc south male management
## 203 7.81 12 1 19 cauc south female management
## 204 10.62 16 6 28 cauc other female management
## 205 4.50 12 3 21 cauc other female management
## 206 17.25 15 31 52 cauc other male management
## 207 10.50 13 14 33 cauc other female management
## 208 9.22 14 13 33 cauc other female management
## 209 15.00 16 26 48 other other male management
## 210 22.50 18 14 38 cauc other male management
## sector union married
## 1 manufacturing no yes
## 1100 manufacturing no yes
## 2 manufacturing no no
## 3 other no no
## 4 other no yes
## 5 other yes no
## 6 other no no
## 7 other no no
## 8 manufacturing no yes
## 9 other no no
## 10 other yes yes
## 11 manufacturing yes no
## 12 other no yes
## 13 other yes no
## 14 other no yes
## 15 construction no yes
## 16 other no yes
## 17 manufacturing yes yes
## 18 other no no
## 19 other no yes
## 20 manufacturing yes yes
## 21 manufacturing yes yes
## 22 other no no
## 23 other no yes
## 24 other no yes
## 25 manufacturing no yes
## 26 manufacturing no yes
## 27 other no yes
## 28 manufacturing no yes
## 29 other no yes
## 30 other no no
## 31 other no no
## 32 other no yes
## 33 other no no
## 34 manufacturing no no
## 35 other no no
## 36 construction no yes
## 37 construction yes yes
## 38 other no no
## 39 manufacturing no yes
## 40 other no no
## 41 manufacturing yes yes
## 42 manufacturing no yes
## 43 manufacturing no yes
## 44 construction no no
## 45 manufacturing no yes
## 46 manufacturing no yes
## 47 other no no
## 48 other yes yes
## 49 manufacturing no yes
## 50 other no yes
## 51 manufacturing yes yes
## 52 manufacturing no yes
## 53 manufacturing no yes
## 54 other no no
## 55 manufacturing no no
## 56 manufacturing no no
## 57 manufacturing no yes
## 58 manufacturing yes no
## 59 manufacturing no yes
## 60 other no no
## 61 construction yes yes
## 62 manufacturing no yes
## 63 construction no no
## 64 manufacturing yes no
## 65 construction no yes
## 66 manufacturing yes yes
## 67 construction yes yes
## 68 manufacturing no yes
## 69 manufacturing yes yes
## 70 manufacturing no no
## 71 other yes yes
## 72 other no yes
## 73 manufacturing no yes
## 74 manufacturing no yes
## 75 manufacturing yes yes
## 76 manufacturing yes yes
## 77 other yes yes
## 78 other no yes
## 79 manufacturing yes yes
## 80 other no no
## 81 other yes yes
## 82 manufacturing yes no
## 83 other no no
## 84 manufacturing yes no
## 85 manufacturing no no
## 86 other yes yes
## 87 other no yes
## 88 other no no
## 89 manufacturing yes yes
## 90 manufacturing no yes
## 91 manufacturing no yes
## 92 other no no
## 93 manufacturing no yes
## 94 manufacturing no yes
## 95 other yes yes
## 96 manufacturing no yes
## 97 construction yes yes
## 98 manufacturing no yes
## 99 other no yes
## 100 other yes yes
## 101 construction no yes
## 102 other no no
## 103 manufacturing no yes
## 104 manufacturing no no
## 105 other no yes
## 106 other yes yes
## 107 construction no yes
## 108 other yes yes
## 109 manufacturing no yes
## 110 other yes yes
## 111 construction no no
## 112 construction yes yes
## 113 construction no no
## 114 construction no yes
## 115 other yes no
## 116 construction no no
## 117 other yes yes
## 118 other no yes
## 119 other no yes
## 120 other yes yes
## 121 manufacturing no no
## 122 other no yes
## 123 manufacturing yes yes
## 124 construction no no
## 125 manufacturing no no
## 126 manufacturing no yes
## 127 other no yes
## 128 manufacturing no yes
## 129 other no no
## 130 other yes no
## 131 manufacturing no no
## 132 other no yes
## 133 manufacturing no no
## 134 manufacturing no no
## 135 construction no yes
## 136 other no no
## 137 manufacturing no yes
## 138 manufacturing no yes
## 139 other no yes
## 140 other no yes
## 141 manufacturing no yes
## 142 manufacturing yes no
## 143 construction yes yes
## 144 construction yes yes
## 145 other no yes
## 146 manufacturing no no
## 147 other yes yes
## 148 other yes yes
## 149 manufacturing no yes
## 150 manufacturing no no
## 151 manufacturing no yes
## 152 other no yes
## 153 other no no
## 154 other no no
## 155 manufacturing no yes
## 429 construction yes yes
## 430 other no yes
## 431 manufacturing no yes
## 432 manufacturing no no
## 433 other no yes
## 434 other no yes
## 435 other no yes
## 436 manufacturing no yes
## 437 other yes no
## 438 other no yes
## 439 manufacturing yes yes
## 440 other no yes
## 441 other no no
## 442 other no yes
## 443 other no no
## 444 other no yes
## 445 other no yes
## 446 other no yes
## 447 other no yes
## 448 other yes yes
## 449 other no no
## 450 other no yes
## 451 other no yes
## 452 other no yes
## 453 manufacturing no no
## 454 other no yes
## 455 other no yes
## 456 other no yes
## 457 manufacturing no no
## 458 other no no
## 459 other no yes
## 460 other no yes
## 461 other no yes
## 462 other no no
## 463 other no no
## 464 other no yes
## 465 other no no
## 466 other no yes
## 467 other no no
## 468 other yes no
## 469 other no yes
## 470 manufacturing no yes
## 471 other no yes
## 472 other yes yes
## 473 other no yes
## 474 other no yes
## 475 other no yes
## 476 other no no
## 477 other no yes
## 478 other no yes
## 479 other yes yes
## 480 construction no yes
## 481 other no yes
## 482 other no yes
## 483 other yes yes
## 484 manufacturing no no
## 485 other no no
## 486 manufacturing no no
## 487 other no no
## 488 other no yes
## 489 other no yes
## 490 other no yes
## 491 other yes no
## 492 other yes yes
## 493 other no yes
## 494 other no no
## 495 other no no
## 496 manufacturing no no
## 497 other yes yes
## 498 other no yes
## 499 other yes no
## 500 other yes yes
## 501 other no yes
## 502 other no yes
## 503 other no yes
## 504 other no no
## 505 other yes no
## 506 other no yes
## 507 other no yes
## 508 other no yes
## 509 other yes yes
## 510 other no yes
## 511 other no yes
## 512 other yes yes
## 513 other yes yes
## 514 other no yes
## 515 other no no
## 516 other no no
## 517 other no no
## 518 other no yes
## 519 other no yes
## 520 other yes yes
## 521 manufacturing no yes
## 522 other yes yes
## 523 other no yes
## 524 other yes yes
## 525 other no yes
## 526 other no no
## 527 other no yes
## 528 other yes no
## 529 other no no
## 530 other no yes
## 531 other yes yes
## 532 other yes yes
## 533 manufacturing no yes
## 346 other no yes
## 347 other no yes
## 348 other no yes
## 349 other no no
## 350 other no no
## 351 other no no
## 352 other no yes
## 353 other no yes
## 354 other no yes
## 355 other no no
## 356 other no no
## 357 other no yes
## 358 other no no
## 359 other yes no
## 360 other no yes
## 361 other no yes
## 362 other no yes
## 363 other no no
## 364 other no yes
## 365 other no no
## 366 other no yes
## 367 other no yes
## 368 other no yes
## 369 other no no
## 370 other no no
## 371 other no yes
## 372 other no yes
## 373 other no yes
## 374 other no no
## 375 other no no
## 376 manufacturing yes yes
## 377 other no no
## 378 other no yes
## 379 other no no
## 380 other yes yes
## 381 other no yes
## 382 other yes no
## 383 other no yes
## 384 other no yes
## 385 other no no
## 386 other no yes
## 387 other yes yes
## 388 other no yes
## 389 other no no
## 390 other no yes
## 391 other yes yes
## 392 other no yes
## 393 other no yes
## 394 other no yes
## 395 other yes no
## 396 other yes yes
## 397 other no no
## 398 other no no
## 399 other no yes
## 400 other yes yes
## 401 other no yes
## 402 other no no
## 403 other yes no
## 404 other no no
## 405 other yes yes
## 406 other no yes
## 407 other no no
## 408 manufacturing no no
## 409 other yes no
## 410 other yes yes
## 411 other no yes
## 412 other no yes
## 413 other yes yes
## 414 other no no
## 415 other no no
## 416 other no no
## 417 other yes yes
## 418 other no no
## 419 other no no
## 420 other no yes
## 421 other no no
## 422 other no yes
## 423 other yes yes
## 424 other no yes
## 425 other no no
## 426 other yes yes
## 427 other no yes
## 428 other no no
## 249 other no yes
## 250 other no yes
## 251 other no yes
## 252 other no no
## 253 other no yes
## 254 manufacturing no yes
## 255 other no no
## 256 other no yes
## 257 other no no
## 258 other no yes
## 259 other yes no
## 260 other no no
## 261 other no yes
## 262 construction no yes
## 263 manufacturing no yes
## 264 other no yes
## 265 other no yes
## 266 other no yes
## 267 other no yes
## 268 other no yes
## 269 other yes yes
## 270 other no yes
## 271 other no yes
## 272 other no yes
## 273 other no yes
## 274 other no no
## 275 other no no
## 276 other no no
## 277 other yes no
## 278 manufacturing no yes
## 279 other no yes
## 280 other no yes
## 281 other no yes
## 282 other no yes
## 283 other no no
## 284 other no no
## 285 manufacturing no yes
## 286 other no yes
## 287 other no yes
## 288 other no yes
## 289 other no no
## 290 other no no
## 291 other no no
## 292 other no yes
## 293 other no no
## 294 other no no
## 295 other no no
## 296 other no yes
## 297 other no yes
## 298 other no no
## 299 other no yes
## 300 other no no
## 301 other no no
## 302 other yes yes
## 303 other no yes
## 304 other no no
## 305 other yes no
## 306 other no no
## 307 other no no
## 308 other no yes
## 309 other yes yes
## 310 other no no
## 311 other no no
## 312 other no no
## 313 other no yes
## 314 other no no
## 315 other no no
## 316 other no no
## 317 other no yes
## 318 other no yes
## 319 other no yes
## 320 other no yes
## 321 other no no
## 322 other yes yes
## 323 other no no
## 324 other no yes
## 325 other no yes
## 326 other no yes
## 327 manufacturing no yes
## 328 other no no
## 329 construction no yes
## 330 other no yes
## 331 manufacturing no no
## 332 other no yes
## 333 other no yes
## 334 other no yes
## 335 other no no
## 336 other no yes
## 337 other no yes
## 338 other no yes
## 339 other no yes
## 340 manufacturing no no
## 341 other no no
## 342 other no yes
## 343 other no no
## 344 other yes yes
## 345 other no yes
## 211 other no yes
## 212 other no yes
## 213 other no yes
## 214 other no no
## 215 other no no
## 216 other no yes
## 217 manufacturing no yes
## 218 other no yes
## 219 other no yes
## 220 other no yes
## 221 other no yes
## 222 other no yes
## 223 other no no
## 224 manufacturing no yes
## 225 other no yes
## 226 other no yes
## 227 other no yes
## 228 other no yes
## 229 other no no
## 230 other no yes
## 231 other no yes
## 232 other no no
## 233 other no yes
## 234 manufacturing no yes
## 235 other no yes
## 236 other no yes
## 237 other no yes
## 238 other no yes
## 239 other yes yes
## 240 other no yes
## 241 other no no
## 242 other no no
## 243 other no yes
## 244 other no yes
## 245 other no no
## 246 other no yes
## 247 other no no
## 248 manufacturing no yes
## 156 other no yes
## 157 other no yes
## 158 other no no
## 159 other no no
## 160 other no yes
## 161 other no no
## 162 other no yes
## 163 other no no
## 164 other no yes
## 165 other no no
## 166 other no no
## 167 other yes yes
## 168 other no yes
## 169 other no yes
## 170 other no no
## 171 manufacturing no yes
## 172 manufacturing no no
## 173 other no yes
## 174 other no no
## 175 other no yes
## 176 other no yes
## 177 other no yes
## 178 other no yes
## 179 other no yes
## 180 other no yes
## 181 other no no
## 182 manufacturing no no
## 183 other no no
## 184 other no yes
## 185 other no yes
## 186 other no yes
## 187 other no yes
## 188 other no no
## 189 other no yes
## 190 other no yes
## 191 other no yes
## 192 other no yes
## 193 other no no
## 194 other no yes
## 195 other yes yes
## 196 other no yes
## 197 other no yes
## 198 other no no
## 199 other no yes
## 200 other no yes
## 201 other no yes
## 202 other no no
## 203 other no no
## 204 manufacturing no yes
## 205 other no yes
## 206 other no yes
## 207 manufacturing no yes
## 208 other no yes
## 209 manufacturing yes yes
## 210 other no yes
#Lập bảng tần số
## sec
## manufacturing construction other
## 99 24 411
##Nhận xét:ngành dựa vào yếu tố cấp độ cho thấy có 441 người làm ngành khác chiếm tỷ lệ cao nhất 76,97%, ngành chế tạo và khai khoáng là 99 người chiếm tỷ lệ vừa phải 18,54%, ngành xây dựng 24 người chiếm tỷ lệ rất thấp 4,49% #Lập bảng tần số cho biến “experience”
##
## (-0.055,9.17] (9.17,18.3] (18.3,27.5] (27.5,36.7] (36.7,45.8]
## 156 169 89 61 51
## (45.8,55.1]
## 8
#Nhận xét: Số năm kinh nghiệm làm việc ở trong khoảng (-0.055,9.17] và (9.17,18.3] chiếm tỉ lệ cao lần lượt là 156 người (chiếm 29,21%) và 169 người (chiếm 31,65%), trong khoảng (18.3,27.5], (27.5,36.7], (36.7,45.8] chiếm tỷ lệ vừa phải lần lượt là 89 nguời (16,67%), 61 người (chiếm 11,42%) và 51 người (chiếm 9,55%) và khoảng (45.8,55.1] chiếm tỷ lệ rất thấp 1,98%
``` #Tuần 1 - giới thiệu dữ liệu