Answered step by step
Verified Expert Solution
Question
1 Approved Answer
The code pse _ data = np . array ( info _ df [ [ pse - same,pse - small ] ] ) grabs
The code
psedata nparrayinfodfpsesame","psesmall"
grabs data from the Pandas dataframe to create a x n numpy array that contains the PSEs for the same and small inducers condition, respectively.
A Please write a function subjectcount that takes psedata as input and applies the shape method to get the number of participants in your dataset and return that as an integer variable.
B Please write a function summarystats that takes psedata as input and uses the methods mean and std or their corresponding numpy commands to compute the mean and standard deviation, seperately for the two conditions, and returns them as two separate variables. Note that both mean and standard deviation can be computed in one line of code.
C Please write a function computeerr that takes psedata as input and computes the standard error and confidence interval, seperately for the two conditions, and returns them as two separate variables. Watch this video also on eClass to learn how to compute standard error using the sample size number of subjects and how to convert standard error to the confidence interval. You can use the command npsqrt to take the square root of a number. Your function should return two variables named:
psestderr # standard error
pseci # confidence interval
D Then use the following code to plot your data as a bar plot with error bars. Try replacing pseci with psestderr in the below and observe how the error bars change:
pltbar psemeans, yerrpsestderr, capsize
pltylim
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started