matlab代写

Aim

The aim of this lab is to use the skills you learned in the Experimental Methods lectures to import and plot some real data from an actual published experiment, plot it, and attempt to replicate the results in the published paper.

Preparation

Go over the lecture slides, and for extra background have a look at Kendrick Kay’s online lectures on using MATLAB for statistics at http://www.cmrr.umn.edu/~kendrick/statsmatlab/ – the first three lectures are the most relevant.

This exercise is based on real data from a published paper in Psychological Science, and is broadly based on an activity guide available at https://sites.trinity.edu/osl/data-sets-and-activities/t- test-activities – but instead of using SPSS, we’ll be using MATLAB to do it, and making code so we can replicate the analysis! So do have a read of the exercise and even download the paper if you like. If you want to, try downloading the .csv files and making your own MATLAB functions to import them based on the lecture material.

Tools

You will need is the MATLAB programming environment. To use this, you will need to logon to a computer in one of the Computer Science labs, open up a terminal window and type the following from the command line:

matlab

You will also need the function ‘NotBoxPlot’, available at https://au.mathworks.com/matlabcentral/ fileexchange/26508-notboxplot?requestedDomain=www.mathworks.com

The data file you will be using is linked here: https://drive.google.com/file/d/0Bz- rhZ21ShvOei1MM24xNndnQ00/view

Background – description of study.

Imagine you were a job candidate trying to pitch your skills to a potential employer. Would you be more likely to get the job after giving a short speech describing your skills, or after writing a short speech and having a potential employer read those words? That was the question raised by Schroeder and Epley (2015). The authors predicted that a person’s speech (i.e., vocal tone, cadence, and pitch) communicates information about their intellect better than their written words (even if they are the same words as in the speech).

To examine this possibility, the authors randomly assigned 39 professional recruiters for Fortune 500 companies to one of two conditions. In the audio condition, participants listened to audio recordings of a job candidate’s spoken job pitch. In the transcript condition, participants read a transcription of the job candidate’s pitch. After hearing or reading the pitch, the participants rated the job candidates on three dimensions: intelligence, competence, and thoughtfulness. These ratings were then averaged to create a single measure of the job candidate’s intellect, with higher scores indicating the recruiters rated the candidates as higher in intellect. The participants also rated their overall impression of the job candidate (a composite of two items measuring positive and negative impressions). Finally, the participants indicated how likely they would be to recommend hiring the job candidate (0 – not at all likely, 10 – extremely likely).

Instructions

  1. Download the data file, available at https://drive.google.com/file/d/0Bz-

    rhZ21ShvOei1MM24xNndnQ00/view

  2. Have a quick look at it in Google Sheets or similar, to work out the variables you will need for the exercise
  3. Import these into MATLAB, making a function as you watched me do in class. Make sure the function only imports the variables you’ll need.
  4. Now make a new script calling the function you just wrote, and using ‘uigetfile’ as I showed you in class. The first thing you will do in this script is import the relevant data.
  5. Use the CONDITION variable to work out indices for each group (the Transcript condition is coded as 0, and the Audio condition is coded as 1). Clue: You might want to use the MATLAB function ‘find’.
  6. Use these indices to make new variables for each group for their scores on Intellect Rating, Impression Rating and Likeliness to Hire.
  7. Look up the help for the MATLAB functions ‘ttest’ and ‘ttest2’. Decide which you will use, and how you will get the t-value, degrees of freedom, p-value and confidence interval.
  8. You should also be able to work out how to get the mean and standard deviation for each variable.
  9. Compare the two groups (Audio and Transcript) on the intellect rating, impression rating and likeliness to hire rating, using the appropriate test. Print the relevant values to the command window using either ‘disp’ or ‘sprintf’.
  10. Now make some plots using the ‘NotBoxPlot’ function I showed you in the lectures. You may need to download this from MATLAB Central. If you have time, read the help for this function and try the demo to see how you can play with the appearance of the graphs.
  11. Now, have a look at Experiment 4 in the actual paper and see if your results match! If they don’t, go back and see what you might have done wrong.
  12. If you like, save your graphs and code.