介绍
两组数据在不同时间点的差异检验结果线图
导入包
import pandas as pd
import seaborn as sns
import matplotlib.pyplot as plt
from scipy import stats
输入数据
ctr = [2, 2, 3, 3, 4, 5, 5, 6, 4, 8, 6, 6, 9, 11, 12, 12, 15, 16, 20, 25, 27]
drug = [2, 3, 2, 3, 4, 3, 3, 4, 5, 5, 6, 6, 8, 7, 6, 7, 8, 11, 10, 11, 15]week = []
for x in range(1, 8):week += [x, x, x]
week += week vals = ctr + druglabels = ['Control'] * 21 + ['Drug_z'] * 21df = pd.DataFrame(zip(vals, week, labels), columns = ['Tumor size', 'Week', 'Treatment'])df.head()