代做PS931 - Bayesian Approaches to Behavioural Science Spring Term 2025代写数据结构语言程序

Data Analysis Assignment

PS931 - Bayesian Approaches to Behavioural Science

Spring Term 2025 (updated: 2024-11-27)

This assessment counts for 42% of your overall grade.

Submission Instructions: Submit your solution as one html or pdf document containing both R code, R output, figures, and written text (i.e., full sentences) to Tabula as “Data Analysis Assignment”, by midday (12 noon), Monday, 17th February 2025 .

•  Please use RMarkdown to create the document.

Important: Your document should be called YOUR-STUDENT-ID_daa  (followed by the correct file extension). Please also add your student ID to the top of the document.  To enable anonymous marking, please refrain from using your name in either the document script or the file name.

•  Your text does not need to contain references (i.e., references to scientific papers).

General Guidelines

There are two tasks. Your answers should have two separate sections for each task, one immediately after the other.

In the first section, write out your answers using complete sentences, as you would for the results section of a paper. Include descriptive statistics in the text, tables or figures, as appropriate.  Tables and figures should be of publication quality (i.e., fully labelled, etc.). Integrate inferential statistics into your description of the results. Your answers might be quite short. Given the validity of the statistical analysis, the first section will play the main role for your mark.

The second section should include the complete R code that you used and its output. Add comments (using  a #) to explain what the code does.  The code should show all of the commands that you used; enough to  replicate exactly what you did (I will be copying and pasting code to run checks, so make sure that works). You can include additional figures in the second section that you used to explore the data, which you do not  wish to include in the first section. I will use the second section to help identify the source of any mistakes. For practical reports and papers you would only submit the first section; thus the first section should stand  alone without requiring the reader to refer to the second section.

To help ensure that the instructions about the answer format are clear, before turning to your assignment tasks, we first provide an example question and an answer that covers the key aspects.  Note that the example answer shows both parts, as is required from you.

Example Question

Does mere exposure to a stimulus improve its attractiveness? In an initial stage, participants were exposed to  a series of pseudowords. Words were exposed for very short durations with a mask.  (Pilot work established that participants were unable to report whether or not a word was presented before the mask in these conditions.)  In a second phase, a mixture of the old, exposed, pseudowords and new, previously unseen, pseudowords were presented.  Participants could view each word for as long as they liked before rating their liking for the word on a 1-10 scale.  Using the data set mere_exposure .csv, test the hypothesis that mere exposure increases the attractiveness of pseudowords.

Example Answer

Section 1 (example)

To investigate whether exposure to a word improves its attractiveness,  32 participants took part in an experiment in which their main task was to rate the attractiveness of pseudowords on a 1-10 scale.  Before the main task, participants were shown half of the pseudowords for a very short duration so that they could not perceive them consciously.  Figure  1 shows the distribution and means of the attractiveness ratings and suggests that pre-exposed pseudowords (i.e., those shown briefly before the main task) were rated as more attractive than new, previously unseen, pseudowords.  We analysed the attractiveness ratings using an ANOVA with a single repeated-measures factor exposure  (old versus new).  The difference in ratings (difference = 1.82, SE = 0.12) was significant, F (1, 31) = 228.33, p < .001, BF10 > 4.9x1012 .

Figure 1 . Attractiveness ratings of pseudowords as a function of prior exposure.  Points in the background show the raw data (overlapping points are offset on the x-axis), black points in the foreground show the mean, error bars show 95% within-subjects confidence intervals.

Section 2 (example)

library ("tidyverse")

library ( "afex")

library ( "emmeans")

mere_exposure  <- read_csv ( "mere_exposure.csv")

glimpse(mere_exposure)

#>  Rows: 32

#> Columns: 3

#> $ id <dbl>  1, 2,  3,  4,  5,  6,  7,  8,  9, 10, 11, 12, 13, 14, 15, 16, 17, ~

#> $ old_ liking <dbl>  7.4,  6 .5,  6 .8,  7.8,  6 .9,  9.2,  6.2,  7.9,  6 .5,  9 . 1,  7. 6,  8 . 6,~

#> $ new_ liking <dbl> 5.6,  5.4, 3.4, 5.2,  6.1, 8.0, 4.4,  6.1, 3.1,  6.4,  6 . 1,  7.8,~

me_tidy  <- mere_exposure %>%

pivot_longer(cols  = -id,  names_to  =  "Exposure" ,  values_to  =  "Attractiveness") %>%

mutate (Exposure  = factor(Exposure),  id  = factor (id))

str (me_tidy)

#>  tibble  [64  x 3] (S3:  tbl_df/tbl/data.frame)

#>   $ id : Factor w/ 32 levels "1","2","3","4", . . :  1  1  2  2  3  3 4 4  5 5  . . .

#>   $ Exposure : Factor w/ 2 levels "new_ liking","old_ liking":  2  1  2  1  2  1  2  1  2  1  . . .

#>   $ Attractiveness: num [1:64] 7.4  5.6  6.5  5.4  6.8  3.4  7.8  5.2 6 .9  6 . 1  . . .

me_tidy %>%

group_by(Exposure) %>%

summarise (mean  = mean (Attractiveness),

sd  = sd(Attractiveness))

#>  # A tibb le:  2  x  3

#>      Exposure mean s d

#> <fct> <dbl>  <dbl>

#>  1 new_ liking 5.74    1.34

#> 2 old_ liking 7.56 1 . 01

ggplot(me_tidy, aes (Attractiveness)) +

geom_histogram() +

facet_wrap (~Exposure)

(a1  <- aov_ez (id  =  "id" ,  dv  =  "Attractiveness" , me_tidy,  within  =  "Exposure"))

#> Anova Table (Type 3 tests)

#>

#> Response: Attractiveness

#> Effect df MSE F g es  p .value

#>  1 Exposure 1,  31 0.23  228 .33  ***   .377 < . 001

#> - - -

#> Signif. codes:    0 ' *** '  0.001   ' ** '  0.01 ' * '  0.05 ' + '  0.1   '   '  1

(a2  <- anovaBF(Attractiveness ~ Exposure + id,  data  = data.frame (me_tidy),  whichRandom  =  "id"))

#> Bayes factor analysis

#> - - - - - - - - - - - - - -

#> [1] Exposure + id :  4 .822112e+12 ±0.85%

#>

#> Against  denominator:

#>     Attractiveness ~ id

#> - - -

#> Bayes factor  type: BFlinearModel,  JZS

pairs (emmeans (a1,  "Exposure"))

#> contrast estimate     SE  df  t .ratio p .value

#> new_ liking - old_ liking -1 .82 0 . 12  31 -15 . 110    < . 0001

afex_plot(a1,  "Exposure" ,  error  =  "within" ,

factor_levels  = list (Exposure  = c("Old" ,  "New")),

data_arg  = list (cex  =  3.5 ,  color  =  "darkgrey"))

Task 1

Decision making is fundamentally noisy, and experimental participants will often make different choices between the same two risky alternative even during the same experimental session. An interesting question is why choices are inconsistent:  is it because participants’ decisions are just inherently noisy?  Or perhaps is it because participants’ deterministic preferences are dynamically changing throughout the experiment, and so they only appear to be stochastic?

To test whether participants’ preferences are dynamically changing it is possible to manipulate the amount of time (i.e., number of intervening trials) between repeated choices. If participants’ preferences are dynamically changing, we would expect that for shorter intervals between repeated choices that participants would make more consistent decisions compared to the consistency for longer intervals.

The file consistency .csv contains simulated data about choice consistency, where participants were split at random to repeat choices at different intervals (variable Interval), where the interval is the number of intervening trials.  Participants (variable id) completed a long series of choices between two alternatives with the repetitions of various alternative pairs hidden within this series.  The variable Consistency gives the proportion of repeated choices for which a participant made the same choice across the two repetitions.

Please analyse the data using both frequentist and Bayesian linear regression models.  The main research question is whether choice consistency decreases with longer intervals. For this task only, please implement your Bayesian linear regression using a variety of R-based implementations and priors, including AIC and BIC, and compare your results for robustness across these implementations and priors.

Present the results as you would in a paper, using APA format.  In other words, describe your statistical model and results and describe the conclusions with regards to the research questions. In the first section of your answer for this task, include only one figure (which may contain multiple panels), with an appropriate figure caption.

Task 2

How does the nature of decision making depend change with repeated experience?  Certainly feedback will influence people’s later decisions, but do decisions change even without feedback?  One possibility is that people become more normative with repeated experience: that their choices correspond more to expected utililty theory.  That is, for Alternative A with a pA1  probability of outcome xA1  and a pA2  probability of outcome xA2, people will (at least implicitly) convert this into an expected utility. If we assume a power law utility function with exponent 0.5, then E(uA ) = pA1(xA1)0.5 + pA2(xA2)0.5 .  Then E(uA ) is compared with the similarly calculated E(uB ), and the alternative with the higher expected utility is chosen.

Another possibility is that choices become more heuristic with practice: that they alight on simple rules for making choices that allow for effective performance with little effort.  For example, people may begin to rely more on simple features of the options that allow them to decide between them.  One simple heuristic would be to avoid the option that has the lowest possible reward.  So for Alternative A, this heuristic value would be hA  = min(xA1, xA2), for Alternative B the heuristic value would be hB  = min(xB1, xB2), and people would choose Alternative A if hA  > hB .  This heuristic will often correspond to expected utility, but will not always do so.

The file repeated_choice .csv contains experimental data from a repeated measures factorial experiment  that investigated how choices changed with repeated experience with the choices.  Participants ( id) were  presented with pairs of alternatives, each with different probabilities of two possible rewards, as above.  There  were 75 alternative pairs in the experiment, and participants were presented with all 75 pairs in each block. Over the course of several days, participants completed 6 blocks (Block) of the experiment.  For each block we calculated as a dependent variable the proportion of trials that matched the predictions of expected  utility (ExpectedUtilityMatch) and the proportion of trials that matched the predictions of the lowest value  heuristic (LowestValueMatch).

Please analyse the data using both a frequentist and Bayesian ANOVA (e.g., using afex and BayesFactor), using post-hoc tests where appropriate, and present the results as you would for a paper, using APA format. In other words, describe your statistical model and results and describe the conclusions with regard to the  research question.  Be careful not to draw unwarranted causal conclusions. In the first section for this task, include only one figure (which may contain multiple panels), with an appropriate figure caption.


热门主题

课程名

mktg2509 csci 2600 38170 lng302 csse3010 phas3226 77938 arch1162 engn4536/engn6536 acx5903 comp151101 phl245 cse12 comp9312 stat3016/6016 phas0038 comp2140 6qqmb312 xjco3011 rest0005 ematm0051 5qqmn219 lubs5062m eee8155 cege0100 eap033 artd1109 mat246 etc3430 ecmm462 mis102 inft6800 ddes9903 comp6521 comp9517 comp3331/9331 comp4337 comp6008 comp9414 bu.231.790.81 man00150m csb352h math1041 eengm4100 isys1002 08 6057cem mktg3504 mthm036 mtrx1701 mth3241 eeee3086 cmp-7038b cmp-7000a ints4010 econ2151 infs5710 fins5516 fin3309 fins5510 gsoe9340 math2007 math2036 soee5010 mark3088 infs3605 elec9714 comp2271 ma214 comp2211 infs3604 600426 sit254 acct3091 bbt405 msin0116 com107/com113 mark5826 sit120 comp9021 eco2101 eeen40700 cs253 ece3114 ecmm447 chns3000 math377 itd102 comp9444 comp(2041|9044) econ0060 econ7230 mgt001371 ecs-323 cs6250 mgdi60012 mdia2012 comm221001 comm5000 ma1008 engl642 econ241 com333 math367 mis201 nbs-7041x meek16104 econ2003 comm1190 mbas902 comp-1027 dpst1091 comp7315 eppd1033 m06 ee3025 msci231 bb113/bbs1063 fc709 comp3425 comp9417 econ42915 cb9101 math1102e chme0017 fc307 mkt60104 5522usst litr1-uc6201.200 ee1102 cosc2803 math39512 omp9727 int2067/int5051 bsb151 mgt253 fc021 babs2202 mis2002s phya21 18-213 cege0012 mdia1002 math38032 mech5125 07 cisc102 mgx3110 cs240 11175 fin3020s eco3420 ictten622 comp9727 cpt111 de114102d mgm320h5s bafi1019 math21112 efim20036 mn-3503 fins5568 110.807 bcpm000028 info6030 bma0092 bcpm0054 math20212 ce335 cs365 cenv6141 ftec5580 math2010 ec3450 comm1170 ecmt1010 csci-ua.0480-003 econ12-200 ib3960 ectb60h3f cs247—assignment tk3163 ics3u ib3j80 comp20008 comp9334 eppd1063 acct2343 cct109 isys1055/3412 math350-real math2014 eec180 stat141b econ2101 msinm014/msing014/msing014b fit2004 comp643 bu1002 cm2030
联系我们
EMail: 99515681@qq.com
QQ: 99515681
留学生作业帮-留学生的知心伴侣!
工作时间:08:00-21:00
python代写
微信客服:codinghelp
站长地图