<SYSTEM_TASK:>
Given the following text description, write Python code to implement the functionality described below step by step
<END_TASK>
<USER_TASK:>
Description:
 <H1>Multivariate regression</H1>
Step1:  Let's evaluate how much the membrane potential depends on Input resistance and 
membrane time constant and the sag ratio. We will create the following multivariate function
<ASSISTANT_TASK:>
Python Code:
%pylab inline
import pandas as pd
#mypath = '/fs3/group/jonasgrp/MachineLearning/Cell_types.xlsx'
mypath = './Cell_types.xlsx'
df = pd.read_excel(io=mypath, sheetname='PFC', skiprows=1)
df.head()
df.columns
df['CellID']
for key in df.columns:
    if df[key].dtype != object:
        print"%-10s = %2.4f + %2.4f" %(key ,df[key].mean(), df[key].std())
means = df[ df.columns ].mean()
means 
df_means = pd.DataFrame(means).T
df_means.head()
df.InputR
df['Vrest'].mean()
df['Vrest'].unique() # get NumPy array
df['Sag'].plot(marker='o', color='red'); # plots
plt.scatter(df['InputR'], df['rheobase'], color='black')
plt.xlabel('Input Resistance (M$\Omega$)'), plt.ylabel('Rheobase (pA)')
plt.xlim(0,400), plt.ylim(0,400);
Explanation: <H1>Multivariate regression</H1>
End of explanation
x = df[['InputR', 'Sag','Tau_mb']]
y = df[['Vrest']]
# import standard regression models (sm)
import statsmodels.api as sm 
K = sm.add_constant(x) # k0, k1, k2 and k3...
# get estimation
est = sm.OLS(y, K).fit() # ordinary least square regression
est.summary() # need more data for kurtosis :)
Explanation: Let's evaluate how much the membrane potential depends on Input resistance and 
membrane time constant and the sag ratio. We will create the following multivariate function:
$f(k;x) = k_0 + k_1x_1 + k_2x_2 + k_3x_3$
where $k$ is a vector or parameters (contants) and $x$ is a vector of independent variables (i.e $x_1$ is the input resistance $x_2$ is membrane time constant and $x_3$ the sag ratio)
End of explanation
<END_TASK>