Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

The code pse _ data = np . array ( info _ df [ [ pse - same,pse - small ] ] ) grabs

The code
pse_data = np.array(info_df[["pse-same","pse-small"]])
grabs data from the Pandas dataframe to create a 2 x n numpy array that contains the PSEs for the same and small inducers condition, respectively.
(A) Please write a function subject_count that takes pse_data 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 summary_stats that takes pse_data 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 compute_err that takes pse_data as input and computes the standard error and 95% 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 95% confidence interval. You can use the command np.sqrt to take the square root of a number. Your function should return two variables named:
pse_stderr # standard error
pse_ci # 95% confidence interval
(D) Then use the following code to plot your data as a bar plot with error bars. Try replacing pse_ci with pse_stderr in the below and observe how the error bars change:
plt.bar((0,1), pse_means, yerr=pse_stderr, capsize=5)
plt.ylim([15,30])

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Understanding Oracle APEX 5 Application Development

Authors: Edward Sciore

2nd Edition

1484209893, 9781484209899

More Books

Students also viewed these Databases questions

Question

What is MSb on your Excel printout?

Answered: 1 week ago