Publications by thongke.club

Hồi quy Panel

07.08.2024

Đọc dữ liệu library(haven) # Đọc tệp .dta data <- read_dta("/Users/thuphan/Downloads/covid2024 (1).dta") # Xem dữ liệu head(data) ## # A tibble: 6 × 29 ## Năm MãCK Tên SAN YEAR NGANH SIZE LN VCSH ETA ROA ## <dbl> <chr> <chr> <chr> <dbl> <chr> <dbl> <dbl> <dbl> <dbl> <dbl> ## 1 20...

341 sym R (14925 sym/51 pcs)

themML

04.06.2023

1. ML theo phân loại dữ liệu cách lấy mẫu: # Define the training control #fitControl <- trainControl( # method = 'cv', # k-fold cross validation # number = 5, # number of folds # savePredictions = 'final', # saves predictions for optimal tuning parameter # classProbs = T, ...

250 sym R (12359 sym/35 pcs)

Imputate by ML

04.06.2023

1. Trực quan dữ liệu lỗi library(dlookr) # for exploratory data analysis and imputation ## ## Attaching package: 'dlookr' ## The following object is masked from 'package:base': ## ## transform dulieu <-airquality dim(dulieu) ## [1] 153 6 plot_na_pareto(dulieu, only_na = TRUE) #plot_na_intersect(dulieu) library(visdat) # ...

208 sym R (9222 sym/63 pcs) 6 img

testCPU

03.06.2023

Tải gói dữ liệu cần thiết #Không chạy được trên r-studio #goi <- c("parallel","doParallel","foreach") #for (package in goi ) { # if (!package %in% installed.packages()) { # install.packages(package) # } # if (!package %in% .packages()) { # library(package, character.only = TRUE) # } #} library(foreach) library(doParall...

98 sym R (841 sym/10 pcs)

testQ Document

22.05.2023

0. Dữ liệu chung obs <-571 sig <-0.3 p <-0.5 a <-rep(c(1:5),c(0.05*obs,0.1*obs,0.15*obs,0.2*obs,0.5*obs)) tt <-rep(c(1:5),round(obs/2)) OIBB <- replace( a,rbinom(obs,1,p)==1,tt) IST <- replace( a,rbinom(obs,1,p)==1,tt) SI <- replace (a, rbinom(obs,1,p)==1,tt) SM <-replace(a, rbinom(obs,1,p)==1,tt) HM <-replace(a, rbinom(obs,1,p)==1,tt) dulie...

235 sym R (21534 sym/50 pcs) 3 img

testSEM

22.05.2023

Tải dữ liệu setwd("/Users/thuphan/Desktop/R-STUDIO") library(seminr) library(readxl) dulieu <- read_excel("dulieuold.xlsx") dulieu <-na.omit(dulieu) head(dulieu) ## # A tibble: 6 × 37 ## OIBB1 OIBB2 OIBB3 OIBB4 OIBB5 SM1 SM2 SM3 SM4 SM5 HM1 HM2 HM3 ## <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl>...

183 sym R (25027 sym/26 pcs)

Lua chon model

16.05.2020

Đọc dữ liệu setwd("d:/DATA2020/jam_nguyen") dulieu <-read.delim("uscities.txt") head(dulieu) ## y x1 x2 x3 x4 x5 x6 ## 1 10 70.3 213 582 6.0 7.05 36 ## 2 13 61.0 91 132 8.2 48.52 100 ## 3 12 56.7 453 716 8.7 20.66 67 ## 4 17 51.9 454 515 9.0 12.95 86 ## 5 56 49.1 412 158 9.0 43.37 127 ## 6 36 54.0 80 80 9.0 40.25...

153 sym R (19230 sym/62 pcs)

Loi nhuan bat thuong

20.04.2020

Tải dữ liệu setwd("d:/DATA2020/CAR/MuaData") library(foreign) dulieu <- read.dta("KetHop12.dta") head(dulieu) ## MACK ThoiGian PRICE GiaDongCua Nam thang VNINDEX Thang ## 1 BCE 20160301 4.08 6.8 2016 03 561.56 03 ## 2 HDA 20160301 11.16 13.4 2016 03 561.56 03 ## 3 DVP 20160301 46.65 66.0 2016 ...

45 sym R (3694 sym/15 pcs)

Hoi quy phan cap

19.04.2020

setwd("c:/vidu") library(foreign) dulieu <- read.dta("muanha2.dta") head(dulieu) ## TIME GIADV NGANG DAI DTICH DTN KCACH MTIEN STHUONG XEHOI SLAU PHONG ## 1 1 0.10172414 6.8 7.0 116 12 10.5 1 0 0 2 3 ## 2 2 0.05309735 10.0 20.0 226 12 10.5 1 0 0 1 3 ## 3 3 0.11538462 6...

52 sym R (6475 sym/10 pcs)

HoiQuySME

01.04.2020

Kết nối dữ liệu options(scipen=999) setwd("d:/DATA2020/SieuNhanMap/dataMua") library(readxl) dulieu <- read_excel("TongHop.xlsx") dulieu <-data.frame(dulieu) head(dulieu) ## Year SME LnSME Shool Labor LnL Chuadaotao Socap Trungcap Caodang ## 1 1995 2649 7.881937 4.83 354724 12.77910 309269 19797 13736 4099 ##...

104 sym R (25678 sym/33 pcs)