This code contains the process, models, figures, and results that were used to analyze the effects of encumbrance and walking on movement time (see section 3.1), pointing offset (see section 3.2), error rate (see section 3.3), target acquisition throughput (see section 3.4), text entry throughput (see section 4.1), uncorrected error rate/corrected error rate (section 4.2), and words per minute (section 4.3) with Bayesian regression models. We plot the results for visual representation and report the posterior probability to further prove our model as well.
2 Library
The key libraries used for model generation and plotting, along with their respective versions, are listed below.
ggplot(mt_poke, aes(x =log(MT))) +geom_histogram(binwidth =0.2, color ="black", fill ="blue") +labs(title ="Histogram of Log-Transformed Data", x ="Log(Movement Time)", y ="Frequency")
mt_model_poke <-brm(MT ~1+ (1|participant) + iterationNum + exercise + (ID * (weight * movement)), mt_poke, family =shifted_lognormal(), iter =4000, save_pars =save_pars(all =TRUE))saveRDS(mt_model, file ="brm_model/mt_model_poke.rds")
Family: shifted_lognormal
Links: mu = identity; sigma = identity; ndt = identity
Formula: MT ~ 1 + (1 | participant) + iterationNum + exercise + (ID * (weight * movement))
Data: no_error_poke (Number of observations: 11877)
Draws: 4 chains, each with iter = 4000; warmup = 2000; thin = 1;
total post-warmup draws = 8000
Multilevel Hyperparameters:
~participant (Number of levels: 30)
Estimate Est.Error l-95% CI u-95% CI Rhat Bulk_ESS Tail_ESS
sd(Intercept) 0.31 0.04 0.24 0.40 1.00 1196 2043
Regression Coefficients:
Estimate Est.Error l-95% CI u-95% CI Rhat Bulk_ESS
Intercept 6.06 0.09 5.87 6.25 1.00 1234
iterationNum -0.05 0.00 -0.06 -0.05 1.00 6569
exercise -0.01 0.01 -0.03 0.00 1.00 1512
ID 0.28 0.04 0.20 0.36 1.00 2542
weight 0.41 0.05 0.31 0.51 1.00 2520
movementWalking 0.17 0.05 0.08 0.27 1.00 2355
weight:movementWalking -0.07 0.07 -0.21 0.07 1.00 2425
ID:weight -0.11 0.06 -0.24 0.02 1.00 2396
ID:movementWalking 0.07 0.06 -0.05 0.19 1.00 2220
ID:weight:movementWalking 0.14 0.09 -0.04 0.31 1.00 2326
Tail_ESS
Intercept 1956
iterationNum 4829
exercise 1908
ID 3563
weight 3709
movementWalking 3541
weight:movementWalking 3152
ID:weight 3430
ID:movementWalking 3674
ID:weight:movementWalking 3349
Further Distributional Parameters:
Estimate Est.Error l-95% CI u-95% CI Rhat Bulk_ESS Tail_ESS
sigma 0.46 0.00 0.45 0.46 1.00 5754 5189
ndt 177.66 0.77 176.00 179.02 1.00 5358 4967
Draws were sampled using sampling(NUTS). For each parameter, Bulk_ESS
and Tail_ESS are effective sample size measures, and Rhat is the potential
scale reduction factor on split chains (at convergence, Rhat = 1).
Model for target acquisition (ray-casting)
ggplot(mt_ray, aes(x =log(MT))) +geom_histogram(binwidth =0.2, color ="black", fill ="blue") +labs(title ="Histogram of Log-Transformed Data", x ="Log(Movement Time)", y ="Frequency")
mt_model_ray <-brm(MT ~1+ (1|participant) + iterationNum + exercise + (ID * (weight * movement)), mt_ray, family =shifted_lognormal(), iter =4000, save_pars =save_pars(all =TRUE))saveRDS(mt_model, file ="brm_model/mt_model_ray.rds")
# Target Acquisition (Direct Selection) Movement Time without Weightprint(bf_mt_poke_weight)
Estimated Bayes factor in favor of mt_model_poke over mt_model_poke_weight: 820921509091744588492921523912306436850208406660350505681406079880328682796688531537873389122028189795077132969143008233710258094292793933802522397854404956123495257448176021010252723556407090137200459203661516901784292374970344931328.00000
# Target Acquisition (Direct Selection) Movement Time without Motionprint(bf_mt_poke_movement)
Estimated Bayes factor in favor of mt_model_poke over mt_model_poke_movement: 45967948027229486546461942633664313557225991762044189197933929938417523452508722244621818754054815040951576832711421876441522343187255757843385028279273071797346437015580344057856.00000
# Target Acquisition (Ray-Casting) Movement Time without Weightprint(bf_mt_ray_weight)
Estimated Bayes factor in favor of mt_model_ray over mt_model_ray_weight: 141699340824287369083892770663921232630760317557146210391409070187606806806564448501760.00000
# Target Acquisition (Ray-Casting) Movement Time without Motionprint(bf_mt_ray_movement)
Estimated Bayes factor in favor of mt_model_ray over mt_model_ray_movement: Inf
# Effect of Weight on Movement Timecombined_weight_plot
# Effect of Motion on Movement Timecombined_motion_plot
# Interaction Effect of Weight and Motion on Movement Timecombined_interaction_plot
This section presents the pointing offset models and the corresponding outcomes from the target acquisition task.
ggplot(offset_poke, aes(x =log(offset))) +geom_histogram(binwidth =0.2, color ="black", fill ="blue") +labs(title ="Histogram of Offset", x ="Log(Offset)", y ="Frequency")
Family: shifted_lognormal
Links: mu = identity; sigma = identity; ndt = identity
Formula: offset ~ 1 + (1 | participant) + iterationNum + exercise + width * (weight * movement)
Data: no_error_poke (Number of observations: 11877)
Draws: 4 chains, each with iter = 4000; warmup = 2000; thin = 1;
total post-warmup draws = 8000
Multilevel Hyperparameters:
~participant (Number of levels: 30)
Estimate Est.Error l-95% CI u-95% CI Rhat Bulk_ESS Tail_ESS
sd(Intercept) 0.11 0.02 0.08 0.14 1.00 1310 2615
Regression Coefficients:
Estimate Est.Error l-95% CI u-95% CI Rhat Bulk_ESS
Intercept 2.43 0.06 2.31 2.54 1.00 1701
iterationNum 0.01 0.00 0.00 0.02 1.00 10533
exercise 0.01 0.00 -0.00 0.01 1.00 1123
width 0.01 0.00 0.00 0.01 1.00 2984
weight -0.25 0.07 -0.39 -0.11 1.00 2577
movementWalking 0.04 0.06 -0.09 0.17 1.00 2548
weight:movementWalking 0.11 0.10 -0.09 0.31 1.00 2131
width:weight 0.00 0.00 0.00 0.00 1.00 2529
width:movementWalking 0.00 0.00 -0.00 0.00 1.00 2572
width:weight:movementWalking -0.00 0.00 -0.00 0.00 1.00 2184
Tail_ESS
Intercept 3206
iterationNum 5816
exercise 1776
width 4884
weight 4206
movementWalking 4210
weight:movementWalking 3668
width:weight 4329
width:movementWalking 4492
width:weight:movementWalking 3957
Further Distributional Parameters:
Estimate Est.Error l-95% CI u-95% CI Rhat Bulk_ESS Tail_ESS
sigma 0.59 0.00 0.59 0.60 1.00 8608 5868
ndt 0.00 0.00 0.00 0.02 1.00 5778 3271
Draws were sampled using sampling(NUTS). For each parameter, Bulk_ESS
and Tail_ESS are effective sample size measures, and Rhat is the potential
scale reduction factor on split chains (at convergence, Rhat = 1).
Model for target acquisition (ray-casting)
ggplot(offset_ray, aes(x =log(offset))) +geom_histogram(binwidth =0.2, color ="black", fill ="blue") +labs(title ="Histogram of Offset", x ="Log(Offset)", y ="Frequency")
# Target Acquisition (Direct Selection) Error Rate without Weightprint(bf_err_poke_weight)
Estimated Bayes factor in favor of err_model_poke over err_model_poke_weight: 504.45755
# Target Acquisition (Direct Selection) Error Rate without Motionprint(bf_err_poke_movement)
Estimated Bayes factor in favor of err_model_poke over err_model_poke_movement: 1269.29526
# Target Acquisition (Ray-Casting) Error Rate without Weightprint(bf_err_ray_weight)
Estimated Bayes factor in favor of err_model_ray over err_model_ray_weight: 83.28777
# Target Acquisition (Ray-Casting) Error Rate without Motionprint(bf_err_ray_movement)
Estimated Bayes factor in favor of err_model_ray over err_model_ray_movement: 960303539253815798042592358768939348005679829458041452384837507437709113691942491964125531173486811208479513378073209565347840.00000
# Effect of Weight on Error Ratecombined_weight_plot
# Effect of Motion on Error Ratecombined_motion_plot
# Interaction Effect of Weight and Motion on Error Ratecombined_interaction_plot
tp_poke <- poke %>%# Step 1: Group by participant, width, distance, and iterationNum, calculate SD of accuracygroup_by(participant, halfWidth, distance, iterationNum) %>%mutate(SD =sd(accuracy, na.rm =TRUE)) %>%ungroup() %>%# Step 2: Calculate ID_emutate(We =4.133* SD,IDe =log2((distance / We) +1)) %>%# Step 3: Calculate TPmutate(TP = IDe / (MT/1000))
ggplot(tp_poke, aes(x =log(TP))) +geom_histogram(binwidth =0.2, color ="black", fill ="blue") +labs(title ="Histogram of Log-Transformed Data", x ="Log(Throughput)", y ="Frequency")
Family: shifted_lognormal
Links: mu = identity; sigma = identity; ndt = identity
Formula: TP ~ 1 + (1 | participant) + iterationNum + exercise + (IDe * (weight * movement))
Data: poke_tp (Number of observations: 11978)
Draws: 4 chains, each with iter = 5000; warmup = 2500; thin = 1;
total post-warmup draws = 10000
Multilevel Hyperparameters:
~participant (Number of levels: 30)
Estimate Est.Error l-95% CI u-95% CI Rhat Bulk_ESS Tail_ESS
sd(Intercept) 0.24 0.03 0.19 0.32 1.00 1525 2675
Regression Coefficients:
Estimate Est.Error l-95% CI u-95% CI Rhat Bulk_ESS
Intercept -0.71 0.07 -0.85 -0.57 1.00 1992
iterationNum 0.04 0.00 0.03 0.04 1.00 9141
exercise 0.01 0.01 -0.00 0.02 1.00 1829
IDe 0.95 0.02 0.90 0.99 1.00 3687
weight -0.33 0.04 -0.40 -0.26 1.00 3566
movementWalking -0.26 0.03 -0.32 -0.19 1.00 3479
weight:movementWalking 0.08 0.05 -0.03 0.18 1.00 3397
IDe:weight 0.10 0.04 0.02 0.17 1.00 3580
IDe:movementWalking 0.11 0.03 0.05 0.18 1.00 3403
IDe:weight:movementWalking -0.15 0.05 -0.26 -0.05 1.00 3431
Tail_ESS
Intercept 2691
iterationNum 5680
exercise 2737
IDe 4673
weight 4861
movementWalking 4220
weight:movementWalking 4734
IDe:weight 5108
IDe:movementWalking 3780
IDe:weight:movementWalking 4477
Further Distributional Parameters:
Estimate Est.Error l-95% CI u-95% CI Rhat Bulk_ESS Tail_ESS
sigma 0.39 0.00 0.39 0.40 1.00 7639 5767
ndt 0.00 0.00 0.00 0.00 1.00 4876 3461
Draws were sampled using sampling(NUTS). For each parameter, Bulk_ESS
and Tail_ESS are effective sample size measures, and Rhat is the potential
scale reduction factor on split chains (at convergence, Rhat = 1).
Model for target acquisition (ray-casting)
tp_ray <- ray %>%# Step 1: Group by participant, width, distance, and iterationNum, calculate SD of accuracygroup_by(participant, halfWidth, distance, iterationNum) %>%mutate(SD =sd(accuracy, na.rm =TRUE)) %>%ungroup() %>%# Step 2: Calculate ID_emutate(We =4.133* SD,IDe =log2((distance / We) +1)) %>%# Step 3: Calculate TPmutate(TP = IDe / (MT/1000))
ggplot(tp_ray, aes(x =log(TP))) +geom_histogram(binwidth =0.2, color ="black", fill ="blue") +labs(title ="Histogram of Log-Transformed Data", x ="Log(Throughput)", y ="Frequency")
# Target Acquisition (Direct Selection) Throughput without Weightprint(bf_tp_poke_weight)
Estimated Bayes factor in favor of tp_model_poke over tp_model_poke_weight: 467430803803050987135571610859256676001244517536043823658105342677392780156011977163175020624827510553968062329916812736912229509000093911257052281022268853140463975881694516181337013876586454750068736.00000
# Target Acquisition (Direct Selection) Throughput without Motionprint(bf_tp_poke_movement)
Estimated Bayes factor in favor of tp_model_poke over tp_model_poke_movement: 10076450288795630919747705896559947944442206091627632411215016413870234056804400923970203659054626685561416909858307143207005661931954688229376.00000
# Target Acquisition (Ray-Casting) Throughput without Weightprint(bf_tp_ray_weight)
Estimated Bayes factor in favor of tp_model_ray over tp_model_ray_weight: 354702725003401265719533688488721599702310771690525950822723418612301824.00000
# Target Acquisition (Ray-Casting) Throughput without Motionprint(bf_tp_ray_movement)
Estimated Bayes factor in favor of tp_model_ray over tp_model_ray_movement: 22242811702178469876925861022274648360435609589962739350233775066912835195327115534771302010582580498352697787396211565501640883188028576125956592795310525932445432793799248767590835617538521847065214976.00000
# Effect of Weight on Target Acquisition Throughputcombined_weight_plot
# Effect of Motion on Target Acquisition Throughputcombined_motion_plot
# Interaction Effect of Weight and Motion on Target Acquisition Throughputcombined_interaction_plot
4 Text Entry Task
This section contains the analysis of text entry task performed in the paper.
ggplot(text_nozero, aes(x = TP)) +geom_histogram(binwidth =0.2, color ="black", fill ="blue") +labs(title ="Histogram of Throughput", x ="Throughput", y ="Frequency")
# Text Entry Throughput without Weightprint(bf_tp_weight)
Estimated Bayes factor in favor of tp_nozero_model over tp_nozero_model_weight: 4660427286.16737
# Text Entry Throughput without Motionprint(bf_tp_movement)
Estimated Bayes factor in favor of tp_nozero_model over tp_nozero_model_movement: 32172716177568100452049714312465671137546631882506495229276867284328419644235462520188214626347686245744933880213869909517975375369632804274962432.00000
# Effect of Weight on Text Entry Throughputcombined_weight_plot
# Effect of Motion on Text Entry Throughputcombined_motion_plot
# Interaction Effect of Weight and Motion on Text Entry Throughputcombined_interaction_plot
ggplot(text_nozero, aes(x = UER)) +geom_histogram(binwidth =0.01, color ="black", fill ="blue") +labs(title ="Histogram of UER", x ="UER", y ="Frequency")
ggplot(text_nozero, aes(x = CER)) +geom_histogram(binwidth =0.01, color ="black", fill ="blue") +labs(title ="Histogram of CER", x ="Log(CER)", y ="Frequency")
ggplot(text_nozero, aes(x =log(WPM))) +geom_histogram(binwidth =0.2, color ="black", fill ="blue") +labs(title ="Histogram of Log-Transformed Data", x ="Log(WPM)", y ="Frequency")