20190123生物科学基礎実験II 生物統計学

提供: 広島大学デジタル自然史博物館 植物
移動: 案内検索

目次

生物科学基礎実験II 生物統計学(2019年1月23日)

Rのダウンロード

Rを使った統計処理で参考になるサイト

ソース

x <- c(7.4,7.2,6.5,7.0,7.6,6.8,7.8,7.3,7.7,7.5,7.1,7.7,7.1,6.8,7.3,6.9,6.7,7.1,7.2,7.6,7.6,7.5,7.8,7.5,7.2,7.4,7.0,7.1,7.3,7.6)
x
sum(x)
y <- c(0.056,0.059,0.046,0.052,0.059,0.056,0.063,0.058,0.063,0.047,0.044,0.048,0.050,0.045,0.061,0.053,0.046,0.050,0.055,0.055,0.058,0.052,0.059,0.056,0.043,0.047,0.046,0.057,0.054,0.063)
y
var(y)
sum(y)
sum(x)
mean(x)
median(x)
which.max(table(x))
var(x)
sd(x)
max(x)
min(x)
range(x)
var(x)
var(y)
var(x,y)
cor(x,y)
waido <- function(x) mean((x-mean(x))^3)/(sd(x)^3)
waido(x)
waido(y)
sendo <- function(x) mean((x-mean(x))^4)/(sd(x)^4)
sendo(x)
sendo(y)
hist(x)
boxplot(x,names=c("x"))
boxplot(x,y)
y
ymg <- y*1000
ymg
species	length
A	3.3
A	6.5
A	2.6
B	9.0
B	8.1
B	7.7
z <- read.delim("clipboard")
z
z[1]
z[2]
z$species
z$length
sum(z$length)
read.csv("data20190123a.csv")
q <- read.csv("data20190123a.csv")
q
data(iris)
iris
mean(iris$Sepal.Length)
source("http://aoki2.si.gunma-u.ac.jp/R/src/all.R", encoding="euc-jp")
result1 <- pca(iris[1:4])
result1
result1$mean
result1$variance
result1$r
result1$fs
result1$eval
result1$factor.loadings
plot(result1$fs[,1:2],pch=as.integer(iris$Species))
plot(result1$fs[,1], result1$fs[,3],pch=as.integer(iris$Species))
plot(result1$fs[,2], result1$fs[,3],pch=as.integer(iris$Species))
data(iris)
source("http://aoki2.si.gunma-u.ac.jp/R/src/all.R", encoding="euc-jp")
result2 <- candis(iris[1:4],iris[5])
result2
plot(result2$can.score,type="n")
points(result2$can.score,pch=as.integer(iris$Species))