Basic Statistics in Julia, Python, and R
Julia
using Statistics
mean(√, [1, 2, 3]) # Output: 1.3820881233139908
Python
import statistics
data = [1, 2, 3]
mean = statistics.mean(data) # Output: 2.0
R
data <- c(1, 2, 3)
mean(data) # Output: 2.0
Advanced Statistics in Julia, Python, and R
Julia
using Statistics
data = [1.0, 2.0, 3.0]
std_dev = std(data) # Output: 1.0
Python
from scipy import stats
data1 = [1, 2, 3, 4]
data2 = [1, 2, 3, 5]
result = stats.wilcoxon(data1, data2)
print(result) # Output: WilcoxonResult(statistic=1.0, pvalue=0.31731050786291415)
R
library(ggplot2)
data <- data.frame(x = c(1, 2, 3), y = c(4, 5, 6))
ggplot(data, aes(x=x, y=y)) + geom_point()
Julia
using Statistics
data = [1.0, 2.0, 3.0]
std_dev = std(data) # Output: 1.0
Python
from scipy import stats
data1 = [1, 2, 3, 4]
data2 = [1, 2, 3, 5]
result = stats.wilcoxon(data1, data2)
print(result) # Output: WilcoxonResult(statistic=1.0, pvalue=0.31731050786291415)
R
library(ggplot2)
data <- data.frame(x = c(1, 2, 3), y = c(4, 5, 6))
ggplot(data, aes(x=x, y=y)) + geom_point()
Tags:
Statistics