Skip to content

Commit

Permalink
delete redundant files
Browse files Browse the repository at this point in the history
  • Loading branch information
QuantumFluxx committed Jul 31, 2022
1 parent 212c736 commit 107fb11
Show file tree
Hide file tree
Showing 102 changed files with 157 additions and 5,644 deletions.
3 changes: 3 additions & 0 deletions Fundamentals of statistics part 2/R tasks/Task 01.r
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
NA_position <- function(x, y){
all(is.na(x) == is.na(y))
}
9 changes: 9 additions & 0 deletions Fundamentals of statistics part 2/R tasks/Task 02.r
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
smart_test <- function(x){
t <- table(x)
if (min(t) >= 5){
chi <- chisq.test(t)
print(c(chi$statistic, chi$parameter, chi$p.value))
}else {
fisher.test(t)[1]
}
}
5 changes: 5 additions & 0 deletions Fundamentals of statistics part 2/R tasks/Task 03.r
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
most_significant <- function(x){
vec <- as.vector(x)
sap <- sapply(vec, function(vec) chisq.test(table(vec))$p.value)
return(names(sap[sap==min(sap)]))
}
5 changes: 5 additions & 0 deletions Fundamentals of statistics part 2/R tasks/Task 04.r
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
dat <- iris[, 1:4]
means <-colMeans(dat)
t_f <- t(t(dat)>means)
rowss <- rowSums(t_f)
iris$important_cases <- factor(ifelse(rowss>=3,"Yes","No"))
7 changes: 7 additions & 0 deletions Fundamentals of statistics part 2/R tasks/Task 05.r
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
get_important_cases <- function(x){
means <- colMeans(x)
t_f <- t(t(x)>means)
rowss <- rowSums(t_f)
x$important_cases <- factor(ifelse(rowss>=ncol(x)%/%2+1,"Yes","No"))
return(x)
}
4 changes: 4 additions & 0 deletions Fundamentals of statistics part 2/R tasks/Task 06.r
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
stat_mode <- function(x){
tablo <- table(x)
return(as.numeric(names(tablo[tablo == max(tablo)])))
}
5 changes: 5 additions & 0 deletions Fundamentals of statistics part 2/R tasks/Task 07.r
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
max_resid <- function(x){
chi_t <- chisq.test(table(x))$stdres
ind <- which(chi_t == max(chi_t), arr.ind = T)
return(c(rownames(ind), rownames(t(chi_t))[ind[2]]))
}
3 changes: 3 additions & 0 deletions Fundamentals of statistics part 2/R tasks/Task 08.r
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
library("ggplot2")
obj <- ggplot(diamonds,aes(x = color, fill = cut))+
geom_bar(position = "dodge")
3 changes: 3 additions & 0 deletions Fundamentals of statistics part 2/R tasks/Task 09.r
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
get_coefficients <- function(dataset){
return(exp(glm(y~x,data = dataset,family = "binomial")$coef))
}
107 changes: 0 additions & 107 deletions Fundamentals of statistics part 2/R tasks/Task 1/R task 1.ipynb

This file was deleted.

107 changes: 0 additions & 107 deletions Fundamentals of statistics part 2/R tasks/Task 1/R task 1.r

This file was deleted.

6 changes: 6 additions & 0 deletions Fundamentals of statistics part 2/R tasks/Task 10.r
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
centered <- function(test_data, var_names){
means <- colMeans(test_data[var_names])
transp <- t(t(test_data[var_names])-means)
test_data[var_names] <- transp
return(test_data)
}
83 changes: 0 additions & 83 deletions Fundamentals of statistics part 2/R tasks/Task 10/Task 10.ipynb

This file was deleted.

Loading

0 comments on commit 107fb11

Please sign in to comment.