STATISTICS EXPLORE 2025
DEPARTMENT OF STATISTICS, UNIVERSITY OF SYAH KUALA BANDA ACEH
Her hafta düzenlenen etkinliklerle bahsegel oyuncularını motive ediyor.
DEPARTMENT OF STATISTICS, UNIVERSITY OF SYAH KUALA BANDA ACEH
8.1 Permutation Variable Importance Program 8.1 rumah = read.csv("rumah.csv") set.seed(50) ambil = sample(1:nrow(rumah), 40) datalatih = rumah[ambil,] datauji = rumah[-ambil,] modellengkap = lm(harga ~ luasbangunan + umur + kamarmandi + dekattol, data=datalatih) RMSEPasli = sqrt(mean((predict(modellengkap, datauji) – datauji$harga)^2)) n.uji = nrow(datauji) permutasi1 = datauji permutasi1$luasbangunan = permutasi1[sample(1:n.uji, n.uji),]$luasbangunan RMSEP1 = sqrt(mean((predict(modellengkap, permutasi1) – datauji$harga)^2)) permutasi2 … Read more
7.1 LASSO Program 7.1 rumah = read.csv("rumah.csv") library(glmnet) x = as.matrix(rumah[,2:7]) y = rumah[,8] model1 <- glmnet(x, y, alpha = 1, lambda = 1) model2 <- glmnet(x, y, alpha = 1, lambda = 3) model3 <- glmnet(x, y, alpha = 1, lambda = 5) matrix(cbind(coef(model1), coef(model2), coef(model3)), ncol=3) Output 7.1 ## [,1] [,2] [,3] ## … Read more
6.2 Best Subset Program 6.1 best = leaps(x=rumah[,2:7], y=rumah[,8], method="adjr2", nbest=2) hasil = data.frame(size=best$size-1, best$which, adjr2=best$adjr2*100) hasil = hasil[order(hasil[,8], decreasing=TRUE),] row.names(hasil) = 1:nrow(hasil) hasil Output 6.1 ## size X1 X2 X3 X4 X5 X6 adjr2 ## 1 3 FALSE TRUE TRUE FALSE FALSE TRUE 84.56957 ## 2 4 FALSE TRUE TRUE FALSE TRUE TRUE 84.37513 … Read more
5.1 Statistik Uji ANOVA Program 5.1 promo <- read.csv("promo.csv") promo2 <- promo[,-c(1,2,4)] promo2$X12 <- promo2$frekuensi.fashion*promo2$nilai.fashion promo2$X13 <- promo2$frekuensi.footwear*promo2$nilai.footwear promo2$X14 <- promo2$frekuensi.lainnya*promo2$nilai.lainnya promo2$X15 <- promo2$total.nilai.tunai/(promo2$X12 + promo2$X13 + promo2$X14) hasil = NULL for(i in c(1:9, 11:14)){ y = promo2[,i] x = promo2$promo F = oneway.test(y ~ x)$statistic hasil = rbind(hasil, c(i, F)) } namavar = colnames(promo2)[-10] … Read more
4.2 Variance Threshold Program 4.1 data <- read.csv("data sapi.csv") data <- data[,-1] head(format(data, digits=6)) ## X1pjg_badan X2ttg_badan X3lkr_badan X4pjg_ekor X5pjg_tanduk Ybbt_badan ## 1 118.488 118.634 191.772 36.1714 15.99607 2836.12 ## 2 170.237 127.834 174.372 35.6906 14.27944 3058.19 ## 3 157.333 155.058 171.637 31.5397 11.45499 3153.16 ## 4 116.805 151.166 194.035 30.3483 10.04847 2923.64 ## 5 … Read more
3.1 Regresi Logistik Program 3.1 # mengimpor data dataEHR <- read.csv("data-EHR.csv", sep=",") # Mengubah peubah “SOURCE” dan “AGE” menjadi factor. library(dplyr) dataEHR <- dataEHR %>% mutate_at(c(10,11),factor) # Memisahkan data menjadi 80% data latih dan 20% data uji. set.seed(123) n <- round(0.2*nrow(dataEHR),0) contoh <- sample(nrow(dataEHR), n, replace = FALSE) EHRlatih <- dataEHR[-contoh,] EHRuji <- dataEHR[contoh,] # … Read more
2.1 Regresi Linier Program 2.1 data <- read.csv("data sapi.csv") data <- data[,-1] regresi <- lm(Ybbt_badan ~ ., data=data) regresi Output 2.1 ## ## Call: ## lm(formula = Ybbt_badan ~ ., data = data) ## ## Coefficients: ## (Intercept) X1pjg_badan X2ttg_badan X3lkr_badan X4pjg_ekor ## 118.8305 6.1877 4.5001 7.4794 1.1279 ## X5pjg_tanduk ## 0.1448 Program 2.2 data … Read more
Welcome to WordPress. This is your first post. Edit or delete it, then start writing!