时间序列分析(3)Python-最简单的回归

# -*- coding: utf-8 -*-
"""
Created on Fri Feb 17 15:08:37 2017

@author: yunjinqi

E-mail:[email protected]

Differentiate yourself in the world from anyone else.
"""
import pandas as pd
from scipy import stats
df=pd.read_csv('C:/Users/Administrator/exam0203.csv')
df
type(df)
x=df.iloc[::,3]
y=df.iloc[::,4]
beta, alpha, r_value, p_value, std_err=stats.linregress(x,y)
beta
alpha
r_value#r_squre=r_value*r_value
p_value
R语言和Python回归结果是相同的,但是Python的界面很不好看,在统计上,Python还是需要进一步努力

你可能感兴趣的:(python)