Notes, assignments, and code for NEUROBIO 735 (Spring 2018).
1/10 – 2/8:
Wednesday, Thursday
3:00 – 4:30
DIBS conference room
Last time, we practiced loading, recoding, and tidying an example dataset. We also worked on a very limited example of exploratory analysis, constructing summary statistics and plots. Today, we’ll push that analysis further, using Matlab to filter our data and ask whether some of our variables make a statistical difference to the outcomes we care about.
In Matlab, taking a subset of rows or columns (often called “slicing” in other languages) works the same for tables as for arrays. And just as we can filter arrays using logical conditions, we can filter the data in tables. For our first analysis, let’s limit our attention to the following:
cued
= 0)RewardOn_sp_count
)Produce a new table restricted to the data subset described above.
What percentage of trials does this subset represent?
We might naturally ask whether spiking responses during the reward period are related to who is receiving reward and how much.
A key question in the original study is what factors influence prosocial choices — those resulting in the outcomes BOTH or OTHER.
Add a binary prosocial
column to the dataset. What percentage of prosocial choices did each subject make? What percentage of prosocial choices did each make as a function of reward?
prosocial
using subj
and reward
as regressors. Your model should include an interaction term between the two, as well as both main effects.
fieldnames
). For future reference, among the most interesting are:
Coefficients
: table of regression coefficients with p-valuesRsquared
: structure with \(R^2\) goodness-of-fit statisticsModelCriterion
: model comparison measures like AIC and BICLogLikelihood
: log likelihood of data given modelThis sort of analysis works when we’re exploring data, but what if we wanted to perform this sort of modeling over multiple datasets, or make a model for every neuron?
In these cases, it helps to write functions that perform a basic analysis so that we can run that function on multiple data subsets.
In a larger analysis, we might use this second variable to determine whether or not to use the returned values from the model.