Produces publication-ready tables with relevant statistics of interest for functions produced from the concurve package.
curve_table(data, levels, type = "c", format = "data.frame")
data | Dataframe from a concurve function to produce a table for |
---|---|
levels | Levels of the consonance intervals or likelihood intervals that should be included in the table. |
type | Indicates whether the table is for a consonance function or likelihood function. The default is set to "c" for consonance and can be switched to "l" for likelihood. |
format | The format of the tables. The options include "data.frame" which is the default, "tibble", "docx" (which creates a table for a word document), "pptx" (which creates a table for powerpoint), "latex", (which creates a table for a TeX document), and "image", which produces an image of the table. |
library(concurve) GroupA <- rnorm(500) GroupB <- rnorm(500) RandomData <- data.frame(GroupA, GroupB) intervalsdf <- curve_mean(GroupA, GroupB, data = RandomData, method = "default") (z <- curve_table(intervalsdf[[1]], format = "data.frame"))#> Lower Limit Upper Limit Interval Width Interval Level (%) CDF P-value #> 2501 -0.035 0.004 0.039 25.0 0.625 0.750 #> 5001 -0.057 0.026 0.083 50.0 0.750 0.500 #> 7501 -0.087 0.055 0.142 75.0 0.875 0.250 #> 8001 -0.095 0.063 0.158 80.0 0.900 0.200 #> 8501 -0.104 0.073 0.177 85.0 0.925 0.150 #> 9001 -0.117 0.085 0.202 90.0 0.950 0.100 #> 9501 -0.136 0.105 0.241 95.0 0.975 0.050 #> 9751 -0.154 0.122 0.276 97.5 0.988 0.025 #> 9901 -0.174 0.143 0.317 99.0 0.995 0.010 #> S-value (bits) #> 2501 0.415 #> 5001 1.000 #> 7501 2.000 #> 8001 2.322 #> 8501 2.737 #> 9001 3.322 #> 9501 4.322 #> 9751 5.322 #> 9901 6.644(z <- curve_table(intervalsdf[[1]], format = "tibble"))#> # A tibble: 9 x 1 #> subdf$`Lower Li… $`Upper Limit` $`Interval Widt… $`Interval Leve… $CDF #> <dbl> <dbl> <dbl> <dbl> <dbl> #> 1 -0.035 0.004 0.039 25 0.625 #> 2 -0.057 0.026 0.083 50 0.75 #> 3 -0.087 0.055 0.142 75 0.875 #> 4 -0.095 0.063 0.158 80 0.9 #> 5 -0.104 0.073 0.177 85 0.925 #> 6 -0.117 0.085 0.202 90 0.95 #> 7 -0.136 0.105 0.241 95 0.975 #> 8 -0.154 0.122 0.276 97.5 0.988 #> 9 -0.174 0.143 0.317 99 0.995 #> # … with 2 more variables: $`P-value` <dbl>, $`S-value (bits)` <dbl>(z <- curve_table(intervalsdf[[1]], format = "latex"))#> #> #> | | Lower Limit| Upper Limit| Interval Width| Interval Level (%)| CDF| P-value| S-value (bits)| #> |:----|-----------:|-----------:|--------------:|------------------:|-----:|-------:|--------------:| #> |2501 | -0.035| 0.004| 0.039| 25.0| 0.625| 0.750| 0.415| #> |5001 | -0.057| 0.026| 0.083| 50.0| 0.750| 0.500| 1.000| #> |7501 | -0.087| 0.055| 0.142| 75.0| 0.875| 0.250| 2.000| #> |8001 | -0.095| 0.063| 0.158| 80.0| 0.900| 0.200| 2.322| #> |8501 | -0.104| 0.073| 0.177| 85.0| 0.925| 0.150| 2.737| #> |9001 | -0.117| 0.085| 0.202| 90.0| 0.950| 0.100| 3.322| #> |9501 | -0.136| 0.105| 0.241| 95.0| 0.975| 0.050| 4.322| #> |9751 | -0.154| 0.122| 0.276| 97.5| 0.988| 0.025| 5.322| #> |9901 | -0.174| 0.143| 0.317| 99.0| 0.995| 0.010| 6.644|(z <- curve_table(intervalsdf[[1]], format = "image"))#> a flextable object. #> col_keys: `Lower Limit`, `Upper Limit`, `Interval Width`, `Interval Level (%)`, `CDF`, `P-value`, `S-value (bits)` #> header has 1 row(s) #> body has 9 row(s) #> original dataset sample: #> Lower Limit Upper Limit Interval Width Interval Level (%) CDF P-value #> 2501 -0.035 0.004 0.039 25 0.625 0.75 #> 5001 -0.057 0.026 0.083 50 0.750 0.50 #> 7501 -0.087 0.055 0.142 75 0.875 0.25 #> 8001 -0.095 0.063 0.158 80 0.900 0.20 #> 8501 -0.104 0.073 0.177 85 0.925 0.15 #> S-value (bits) #> 2501 0.415 #> 5001 1.000 #> 7501 2.000 #> 8001 2.322 #> 8501 2.737