<jupyter_start><jupyter_text>---author: <NAME> (<EMAIL>)--- We assume you have already fit a multivariate linear model to some data, as in the code below. (If you're unfamiliar with how to do so, see how to fit a multivariate linear model.) The data shown below is fake, and we assume you will replace it with your own real data if you use this code.<jupyter_code>import pandas as pd
import statsmodels.api as sm
df = pd.DataFrame( {
    'x1':[2, 7, 4, 3, 11, 18, 6, 15, 9, 12],
    'x2':[4, 6, 10, 1, 18, 11, 8, 20, 16, 13],
    'x3':[11, 16, 20, 6, 14, 8, 5, 23, 13, 10],
    'y':[24, 60, 32, 29, 90, 45, 130, 76, 100, 120]
} )
xs = df[['x1', 'x2', 'x3']]
y = df['y']
xs = sm.add_constant(xs)
model = sm.OLS(y, xs).fit()<jupyter_output>/opt/conda/lib/python3.9/site-packages/statsmodels/tsa/tsatools.py:142: FutureWarning: In a future version of pandas all arguments of concat except for the argument 'objs' will be keyword-only
  x = pd.concat(x[::order], 1)<jupyter_text>You can get a lot of information about your model from its summary.<jupyter_code>model.summary()<jupyter_output>/opt/conda/lib/python3.9/site-packages/scipy/stats/stats.py:1541: UserWarning: kurtosistest only valid for n>=20 ... continuing anyway, n=10
  warnings.warn("kurtosistest only valid for n>=20 ... continuing "<jupyter_text>In particular, that printout contains the Adjusted $R^2$ value; it is the second value in the right-hand column, near the top.You can also obtain it directly, as follows:<jupyter_code>model.rsquared_adj<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.13692407527579495, 'fraction_numerical': 0.06164828033744322, 'mean_word_length': 4.546762589928058, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 15, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 1, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '3', 'dir': 'jupyter-structured-clean-dedup', 'id': '162997', 'license': 'MIT', 'n_tokens_mistral': 635, 'n_tokens_neox': 547, 'n_words': 197, 'path': 'database/tasks/How to compute adjusted R-squared/Python, using statsmodels.ipynb', 'repo_name': 'nathancarter/how2data', 'size': '1570'}