Skip to content

Instantly share code, notes, and snippets.

@chums2020
chums2020 / retroDesign.py
Created March 17, 2019 09:51
Translates Gelman's retrodesign function from R to Python
from scipy.stats import t
def retroDesign(A, s, alpha=0.05, df=1000000, n_sims=10000):
"""
:param A: the hypothesized true effect size
:param s: standard error
:param alpha: confidence level
:param df: degree of freedom
@chums2020
chums2020 / Rwordseg.R
Created June 2, 2016 22:12 — forked from s13731105/Rwordseg.R
用 R 進行中文 text Mining
library(XML)
library(RCurl)
library(tm)
library(tmcn)
library(Rwordseg)
setwd("C:/test")
d.corpus <-Corpus(DirSource("/test/doc"), readerControl = list(language="UTF-8"))
#上兩行為抓取本機文字檔, 餘皆同網路上說明文字