# ---
# jupyter:
#   jupytext:
#     text_representation:
#       extension: .py
#       format_name: light
#       format_version: '1.5'
#       jupytext_version: 1.14.4
#   kernelspec:
#     display_name: Python 3
#     language: python
#     name: python3
# ---

# # Handout 11

# +
#RCBD
# -

#Relative Efficiency of blocking
def relative_eff(r,t,MSB,MSE):
    K = r*(t-1)/(r*t-1)
    RE = K + (1-K) * MSB/MSE
    return RE


# +
#RCBD on page 17
# -

#Friedman's Test
from scipy.stats import friedmanchisquare
#remake R code on page 29
y = [26.1, 81.0, 10.5, 26.6, 12.9, 57.2, 25.0, 20.3,
22.7, 53.2, 9.7, 19.6, 13.8, 47.1, 13.6, 23.6,
22.5, 53.7, 10.8, 21.1, 13.7, 39.2, 13.7, 16.3,
22.6, 53.1, 8.3, 21.6, 13.3, 37.0, 14.8, 14.8]
A, B, C, D = y[:8], y[8:16], y[16:24], y[24:]
friedmanchisquare(A, B, C, D)

# +
#rbskinpotential.sas page 24

# +
#lsdesign.sas page 37

# +
#relative efficiency of latin square design

StarcoderdataJupyterScriptsDedupFiltered