Skip to content

Instantly share code, notes, and snippets.

View axjack's full-sized avatar

Satoaki Noguchi axjack

View GitHub Profile
@axjack
axjack / Ch13.R
Created September 12, 2022 13:24
第13章:ノンパラメトリック法
# --------------------
# p100~: ウィルコクソンの順位和検定
# --------------------
# 成績テーブル
df1 <- data.frame(
score = c(30,20,52,40,50,35)
, grp = rep(c('A','B'),each=3)
)
@axjack
axjack / test.md
Created May 20, 2022 12:59
数式書けるかテスト
@axjack
axjack / tjw_ch17_dat.csv
Created April 16, 2022 11:29
統計学実践ワークブック 第17章 47都道府県の乗車所有率(c.ratio)と人口密度(p.density)
PrefNumber PrefName Pop NumCar p.density c.ratio
01 北海道 5320000 2810521 2.378 0.5282934210526316
02 青森 1280000 730409 3.957 0.57063203125
03 岩手 1260000 742462 3.379 0.5892555555555555
04 宮城 2320000 1298525 7.3629999999999995 0.559709051724138
05 秋田 1000000 592118 3.108 0.592118
06 山形 1100000 695930 3.8200000000000003 0.6326636363636363
07 福島 1880000 1224727 4.463 0.6514505319148937
08 茨城 2890000 1981386 7.275 0.6856006920415225
09 栃木 1960000 1338596 6.561 0.6829571428571428
@axjack
axjack / tjwkbk_ch16_pp135-136.R
Created April 12, 2022 14:06
統計学実践ワークブック 第16章 重回帰分析 pp.135-136
# ------------------------------
# 統計学実践ワークブック
# 第16章 重回帰分析 pp.135-136
# ------------------------------
rm(list=ls())
# NAのある行は除外する
# library(tidyverse)
# air <- drop_na(airquality,everything())
air <- na.omit(airquality)
@axjack
axjack / -isbn_978-4-7806-0852-6_edition1_printing4_p175_20_6.ipynb
Created December 3, 2021 09:29
ISBN_978-4-7806-0852-6_Edition1_Printing4_p175_20_6.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@axjack
axjack / Q23.2.R
Created November 27, 2021 05:31
問23.2
# -------------
# 第23章 判別分析
# 問23.2 p.213
# -------------
# データ
LD1 <- c(-0.1,-0.1,0.2,0.4,0.9)
LD2 <- c(0.0,0.2,-0.2,0.9,-0.3)
x1 <- c(1.2,1.4,0.3,6.0,4.6)
x2 <- c(1.4,1.4,0.3,0.7,2.1)
@axjack
axjack / kaisou.html
Created November 21, 2021 14:49
階層構造
<!DOCTYPE html>
<html>
<head>
<style type="text/css">
details details{
margin-left: 20px;
}
dl{
@axjack
axjack / toukeigakujissen_workbook.notebook.jl
Created August 17, 2021 14:22
統計学実践ワークブック〜例題を解く〜
### A Pluto.jl notebook ###
# v0.15.1
using Markdown
using InteractiveUtils
# ╔═╡ 97f38c7e-ff5e-11eb-33d6-55d83b7be2d9
md"""
# 統計学実践ワークブック〜例題を解く〜
## やること
@axjack
axjack / tiny_R_script.R
Created July 28, 2021 14:52
tiny_R_script.R
x <- c(100,100,100,200,200,300,300,300,400)
y <- rep( c('A','B','C'), 3 )
z <- sample(1:9,9, replace = T)
df <- data.frame(x,y,z)
library(Matrix)
x1 <- factor(df$x)
y1 <- factor(df$y)
@axjack
axjack / View_rules.R
Created May 24, 2021 11:16
View arule's rules via DATAFRAME()
View_rules <- function(rule){
# View arule's rules via DATAFRAME()
if( !("arules" %in% (.packages())) ){
stop("Make sure to execute library(arules) at first.")
}
if( class(rule) != "rules" ){
stop("Pass rules into argument.")
}
View( arules::DATAFRAME(rule,setStart="",setEnd="") )
}