Lab#
Learning Objectives#
At the end of this learning activity you will be able to:
Practice using robust correlation tools that account for outliers.
Practice using
pg.qqplot
andpg.normality
to asses the normality of residuals.Practice using regression to create covariate-controlled scores.
import numpy as np
import seaborn as sns
import pandas as pd
import matplotlib.pyplot as plt
import pingouin as pg
%matplotlib inline
data = pd.read_csv('hiv_neuro_data.csv')
data['education'] = data['education'].astype(float)
data.head()
This lab is going to explore the inter-relationships between two cognitive domains.
Executive Function: The complex cognitive processes required for planning, organizing, problem-solving, abstract thinking, and executing strategies. This domain also encompasses decision-making and cognitive flexibility, which is the ability to switch between thinking about two different concepts or to think about multiple concepts simultaneously.
Speed of Information Processing: How quickly an individual can understand and react to the information being presented. This domain evaluates the speed at which cognitive tasks can be performed, often under time constraints.
We will explore whether these two domains are correllated after controlling for co-variates.
Q2: Create a regression for the processing domain that accounts for demographic covariates.#
Age
Race
Sex
Education
Years Seropositive
ART
# Perform the regression using `pg.linear_regression`
# Use the result to answer the questions below
# Assess the normality of the residuals of the model
q2_model_resid_normal = ...
# Considering a p<0.01 threshold answer which of the following are significant
# Age
q2_processing_age = ...
# Race
q2_processing_race = ...
# Sex
q2_processing_sex = ...
# Education
q2_processing_edu = ...
# Infection length
q2_processing_ys = ...
# ART
q2_processing_art = ...
grader.check("q2_exec_adj")
Submission#
Check:
That all tables and graphs are rendered properly.
Code completes without errors by using
Restart & Run All
.All checks pass.
Then save the notebook and the File
-> Download
-> Download .ipynb
. Upload this file to BBLearn.