mnreadCurve: MNREAD curve plotting.

Description Usage Arguments Value Notes Warning See Also Examples

View source: R/mnread_curve.R

Description

This function plots individual MNREAD curves, while showing the estimated MNREAD parameters:

Usage

1
2
3
4
5
6
7
8
mnreadCurve(
  data,
  print_size,
  viewing_distance,
  reading_time,
  errors,
  ... = NULL
)

Arguments

data

The name of your dataframe

print_size

The variable that contains print size values for each sentence (print size uncorrected for viewing distance)

viewing_distance

The variable that contains the viewing distance value used for testing

reading_time

The variable that contains the reading time for each sentence

errors

The variable that contains the number of errors for each sentence

...

Optional grouping arguments

Value

The function returns a plot of reading speed (in words/min) as a function of print size (in logMAR). Reading Acuity is marked as a triangle, Maximum Reading Speed and Critical Print Size are shown with dashed lines. When using two grouping arguments, a colored diamond is added for clarification. Highlighted data points represent the range of print sizes included in the Reading Accessibility Index calculation.

Notes

This function can't take more that two grouping arguments. The first grouping argument is used to draw sub-plots (using facet_wrap from ggplot2). The second grouping argument is color-coded.

This function performs print size correction for non-standard testing viewing distance before plotting the curve.

This function uses the original algorithm described in Legge (2007) to estimate Maximum Reading Speed (MRS) and Critical Print Size (CPS). For more details on the parameters estimation, see curveParam_RT.

Warning

For the function to run properly, one needs to make sure that the variables are of the class:

In cases where only 3 or less sentences were read during a test, MRS and CPS cannot be estimated and won't be displayed on the plot. In such cases, the Reading Accessibility Index (ACC) can be used to estimate the MNREAD score instead (cf. accIndex).

To ensure proper plotting, the data should be entered along certain rules:

See Also

curveParam_RT for standard estimation of MRS and CPS using values of reading time (instead of reading speed)

readingAcuity for Reading Acuity calculation

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
# inspect the structure of the dataframe
head(data_low_vision, 10)

#------

# restrict dataset to one MNREAD test only (subject s1, regular polarity)
data_s1_reg <- data_low_vision %>%
   filter (subject == "s1", polarity == "regular")

# plot the MNREAD curve 
## Not run:  mnreadCurve(data_s1_reg, ps, vd, rt, err)  

#------

# restrict dataset to one subject (s1) and plot the MNREAD curves using ONE GROUPING ARGUMENT 
# (ie. polarity) 
data_s1 <- data_low_vision %>%
   filter (subject == "s1")

# plot the MNREAD curve using ONE GROUPING ARGUMENT (ie. polarity)
 ## Not run:  mnreadCurve(data_s1, ps, vd, rt, err, polarity)  

#------

# restrict dataset to two subject (s1 & s2) and plot the MNREAD curves using TWO GROUPING ARGUMENTS 
# (ie. subject and polarity) 
data_s2 <- data_low_vision %>%
   filter (subject == "s1" | subject == "s2")

 ## Not run:  mnreadCurve(data_s2, ps, vd, rt, err, subject, polarity)  

#------

# Once created, the MNREAD curve can be customized as needed using ggplot2, 
# for ex., by adding the number of errors for each sentence on top of the curve

# plot the MNREAD curve 
my.plot <- mnreadCurve(data_s1, ps, vd, rt, err, polarity)

# display my.plot
print(my.plot)

# calculate reading speed and perform print size correction
data_s1_new <- as.data.frame(
data_s1 %>%
    filter (err != "NA" & rt > 0) %>%
    mutate (errors10 = replace (err, err > 10, 10) ) %>%
    mutate (rs = 60 * (10 - errors10) / rt ) %>%
    mutate (correct_ps = ps + round(log10(40/(vd)), 2)) ) 

# add the number of errors for each sentence 
my.new.plot <- my.plot + geom_text(aes(x = correct_ps, y = rs + 5, label = errors10),
                                   alpha = 0.5,
                                   data = data_s1_new %>% filter (errors10 != 0) )

# display my.new.plot                                                                        
print(my.new.plot)

#------

# MNREAD curves can also be saved in a pdf file, with each page showing a different subject
 
# count the number of subjects to define the number of pages
num_pages = length(unique(data_s2$subject))

# create a pdf file 
## Not run:  
pdf ("MNREAD_curves.pdf", width = 10.5, height = 8, paper = "special", useDingbats = TRUE)

# wrap the plots over several pages
for (i in seq(num_pages)){
    p <- mnreadCurve(data_s2 %>% filter (subject == sort(unique(data_s2$subject))[i]),
                     ps, vd, rt, err, subject, polarity) 
    print(p)
}

dev.off()  

## End(Not run)

mnreadR documentation built on June 25, 2021, 1:07 a.m.

Related to mnreadCurve in mnreadR...