
Convert Likert Data to Relative Scores and knowledge-based Adaptive Capacity
Source:R/relative_likert.R
relative_likert.Rd
Adaptive capacity refers to the ability of systems—biological, social, or institutional—to adjust to environmental changes, capitalize on emerging opportunities, and mitigate potential threats in order to preserve essential functions. In the context of climate change, adaptive capacity denotes the competence of social-ecological systems to cope with present variability and prepare for uncertain future conditions.
From a machine learning perspective, adaptive capacity is closely linked to the system’s ability to process large-scale, heterogeneous data sources, identify patterns, and support the development of predictive models and adaptive strategies. Key components of adaptive capacity include access to relevant and reliable information, computational infrastructure, financial and human capital, and strong social and institutional networks.
Machine learning can enhance adaptive capacity by enabling dynamic learning from historical and real-time data, improving climate risk assessments, and optimizing adaptation strategies. Moreover, the iterative nature of model refinement and feedback integration mirrors the learning processes inherent in adaptive systems. Thus, adaptive capacity in this context involves not only the ability to design and implement effective interventions but also to learn from outcomes and continuously update strategies in light of new data and evolving conditions.
This function is for knowledge-based Adaptive Capacity. The indices from
the various knowledge areas like Awareness, availability, affordability,
accessibility, benefits, adequacy, usage, effectiveness, etc can be
obtained individually and converted to adaptive capacity. Adaptive
capacity based on financial and human capital, strong social and
institutional networks can be obtained from model_factors()
.
Arguments
- data
Data frame of likert data either in text or scores.
- Likert
Vector of likert-type factors in descending order as in the data frame which must be given if the data frame is in text.
- Ranks
Optional vector of number of levels which is required if the data frame is in scores rather than text. There are only four choices i.e. 3, 5, 7, 9.
- Option
Optional vector indicating whether the data frame is in text or scores format. Defaults to text if not given for text data frame.
Value
A list with the following components:
lik_num
dataframe
of likert scoreslik_rate
dataframe
of relative likert scoreslik_sum
dataframe
summary of relative scores based on factors.lik_col
A vector of indices for Adaptive Capacity.
Examples
library(readr)
garrett_data <- data.frame(garrett_data)
relative_likert(garrett_data, Ranks = 3, Option = "sccore")
#> Preliminary check success, proceeding...
#> Likert lenght check success, proceeding...
#> Success, DONE!
#> $lik_num
#> S1 S2 S3 S4 S5 S6 S7 S8 S9 S10 S11 S12 S13 S14 S15
#> 1 10 1 6 5 5 7 11 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> S1 S2 S3 S4 S5 S6 S7 S8 S9 S10 S11 S12 S13
#> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl>
#> 1 0 0.333 0 0 0 0 0 0.333 0 0 0 0 0
#> 2 0 1 0 0.667 0 0 0.667 1 0 0.667 0 0 0.667
#> 3 0 0 0 0.667 0.667 0 0 0.333 0.333 0.667 0.667 0 0
#> 4 0 0 1 1 0 0.333 0 0.667 0 1 0 0.333 0
#> 5 0 0 1 0 0 0.333 0 0.333 0 0 0 0.333 0
#> 6 0 0 0 0.333 1 1 0 0 0.667 0.333 1 1 0
#> 7 1 0 0 0.667 0.667 0 0.333 0 0.667 0.667 0.667 0 0.333
#> 8 0 0 1 1 0 1 0 0.333 0 1 0 1 0
#> 9 0 0.667 0.667 0 0 0.333 0 0.333 0 0 0 0.333 0
#> 10 0 0 0.667 0.667 0 1 0 1 0 0.667 0 1 0
#> # ℹ 19 more rows
#> # ℹ 2 more variables: S14 <dbl>, S15 <dbl>
#>
#> $lik_sum
#> Mean SD SE.Mean Min Median Max Q1 Q3 Skewness Kurtosis Nobs
#> S1 0.09 0.28 0.05 0 0.00 1.00 0.00 0.00 2.91 5.22 29
#> S2 0.13 0.30 0.06 0 0.00 1.00 0.00 0.00 2.26 2.64 29
#> S3 0.30 0.41 0.08 0 0.00 1.00 0.00 0.67 0.82 -1.27 29
#> S4 0.40 0.41 0.08 0 0.33 1.00 0.00 0.67 0.31 -1.63 29
#> S5 0.39 0.45 0.08 0 0.00 1.00 0.00 1.00 0.39 -1.79 29
#> S6 0.39 0.40 0.07 0 0.33 1.00 0.00 0.67 0.45 -1.46 29
#> S7 0.07 0.19 0.03 0 0.00 0.67 0.00 0.00 2.70 4.58 29
#> S8 0.41 0.32 0.06 0 0.33 1.00 0.33 0.33 0.82 -0.45 29
#> S9 0.13 0.26 0.05 0 0.00 0.67 0.00 0.00 1.67 0.35 29
#> S10 0.40 0.41 0.08 0 0.33 1.00 0.00 0.67 0.31 -1.63 29
#> S11 0.39 0.45 0.08 0 0.00 1.00 0.00 1.00 0.39 -1.79 29
#> S12 0.39 0.40 0.07 0 0.33 1.00 0.00 0.67 0.45 -1.46 29
#> S13 0.07 0.19 0.03 0 0.00 0.67 0.00 0.00 2.70 4.58 29
#> S14 0.41 0.32 0.06 0 0.33 1.00 0.33 0.33 0.82 -0.45 29
#> S15 0.13 0.26 0.05 0 0.00 0.67 0.00 0.00 1.67 0.35 29
#>
#> $lik_col
#> [1] 0.067 0.378 0.267 0.333 0.156 0.400 0.378 0.378 0.178 0.400 0.267 0.133
#> [13] 0.422 0.400 0.400 0.222 0.222 0.289 0.178 0.133 0.333 0.267 0.267 0.356
#> [25] 0.311 0.311 0.133 0.089 0.267
#>
relative_likert(garrett_data, Ranks = 5, Option = "sccore")
#> Preliminary check success, proceeding...
#> Likert lenght check success, proceeding...
#> Success, DONE!
#> $lik_num
#> S1 S2 S3 S4 S5 S6 S7 S8 S9 S10 S11 S12 S13 S14 S15
#> 1 10 1 6 5 5 7 11 1 7 5 5 7 11 1 7
#> 2 9 3 13 2 0 14 2 3 7 2 0 14 2 3 7
#> 3 13 9 13 2 2 0 12 1 1 2 2 0 12 1 1
#> 4 16 5 3 3 5 1 9 2 9 3 5 1 9 2 9
#> 5 16 8 3 4 7 1 8 1 5 4 7 1 8 1 5
#> 6 17 16 5 1 3 3 6 0 2 1 3 3 6 0 2
#> 7 3 4 11 2 2 20 1 8 2 2 2 20 1 8 2
#> 8 12 16 3 3 0 3 9 1 6 3 0 3 9 1 6
#> 9 30 2 2 4 4 1 4 1 5 4 4 1 4 1 5
#> 10 15 9 2 2 5 3 9 3 5 2 5 3 9 3 5
#> 11 17 5 6 6 3 2 8 1 5 6 3 2 8 1 5
#> 12 16 6 7 6 2 0 10 1 5 6 2 0 10 1 5
#> 13 19 3 8 1 3 1 11 3 4 1 3 1 11 3 4
#> 14 43 0 2 1 2 2 0 3 0 1 2 2 0 3 0
#> 15 3 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 0.8 0.2 1 0.8 0.8 0.2 0.8
#> 10 0 0 0.4 0.4 1 0.6 0 0.6 1 0.4 1 0.6 0
#> # ℹ 19 more rows
#> # ℹ 2 more variables: S14 <dbl>, S15 <dbl>
#>
#> $lik_sum
#> Mean SD SE.Mean Min Median Max Q1 Q3 Skewness Kurtosis Nobs
#> S1 0.06 0.17 0.03 0 0.0 0.6 0.0 0.0 2.91 5.22 29
#> S2 0.33 0.41 0.08 0 0.0 1.0 0.0 0.8 0.68 -1.43 29
#> S3 0.27 0.32 0.06 0 0.0 1.0 0.0 0.6 0.71 -1.02 29
#> S4 0.49 0.33 0.06 0 0.4 1.0 0.2 0.8 -0.01 -1.15 29
#> S5 0.63 0.34 0.06 0 0.6 1.0 0.4 1.0 -0.56 -0.89 29
#> S6 0.34 0.29 0.05 0 0.4 0.8 0.0 0.6 0.21 -1.42 29
#> S7 0.10 0.22 0.04 0 0.0 0.8 0.0 0.0 2.49 3.92 29
#> S8 0.25 0.19 0.04 0 0.2 0.6 0.2 0.2 0.82 -0.45 29
#> S9 0.48 0.42 0.08 0 0.4 1.0 0.0 0.8 0.01 -1.76 29
#> S10 0.49 0.33 0.06 0 0.4 1.0 0.2 0.8 -0.01 -1.15 29
#> S11 0.63 0.34 0.06 0 0.6 1.0 0.4 1.0 -0.56 -0.89 29
#> S12 0.34 0.29 0.05 0 0.4 0.8 0.0 0.6 0.21 -1.42 29
#> S13 0.10 0.22 0.04 0 0.0 0.8 0.0 0.0 2.49 3.92 29
#> S14 0.25 0.19 0.04 0 0.2 0.6 0.2 0.2 0.82 -0.45 29
#> S15 0.48 0.42 0.08 0 0.4 1.0 0.0 0.8 0.01 -1.76 29
#>
#> $lik_col
#> [1] 0.31 0.23 0.16 0.40 0.33 0.31 0.28 0.23 0.56 0.51 0.36 0.21 0.36 0.24 0.24
#> [16] 0.43 0.37 0.44 0.43 0.48 0.44 0.59 0.33 0.41 0.49 0.19 0.32 0.29 0.21
#>
relative_likert(garrett_data, Ranks = 7, Option = "sccore")
#> Preliminary check success, proceeding...
#> Likert lenght check success, proceeding...
#> Success, DONE!
#> $lik_num
#> S1 S2 S3 S4 S5 S6 S7 S8 S9 S10 S11 S12 S13 S14 S15
#> 1 10 1 6 5 5 7 11 1 7 5 5 7 11 1 7
#> 2 9 3 13 2 0 14 2 3 7 2 0 14 2 3 7
#> 3 13 9 13 2 2 0 12 1 1 2 2 0 12 1 1
#> 4 16 5 3 3 5 1 9 2 9 3 5 1 9 2 9
#> 5 16 8 3 4 7 1 8 1 5 4 7 1 8 1 5
#> 6 17 16 5 1 3 3 6 0 2 1 3 3 6 0 2
#> 7 3 4 11 2 2 20 1 8 2 2 2 20 1 8 2
#> 8 12 16 3 3 0 3 9 1 6 3 0 3 9 1 6
#> 9 30 2 2 4 4 1 4 1 5 4 4 1 4 1 5
#> 10 15 9 2 2 5 3 9 3 5 2 5 3 9 3 5
#> 11 17 5 6 6 3 2 8 1 5 6 3 2 8 1 5
#> 12 16 6 7 6 2 0 10 1 5 6 2 0 10 1 5
#> 13 19 3 8 1 3 1 11 3 4 1 3 1 11 3 4
#> 14 43 0 2 1 2 2 0 3 0 1 2 2 0 3 0
#> 15 3 42 1 3 0 0 2 0 2 3 0 0 2 0 2
#> 16 17 4 12 5 3 6 1 1 4 5 3 6 1 1 4
#> 17 9 10 6 4 5 2 8 3 6 4 5 2 8 3 6
#> 18 18 8 3 5 5 2 9 1 2 5 5 2 9 1 2
#> 19 11 12 4 6 5 3 6 1 5 6 5 3 6 1 5
#> 20 10 16 4 2 5 4 7 1 4 2 5 4 7 1 4
#> 21 15 10 3 2 5 3 10 1 4 2 5 3 10 1 4
#> 22 21 2 9 3 4 4 4 2 4 3 4 4 4 2 4
#> 23 14 5 7 3 2 4 10 1 7 3 2 4 10 1 7
#> 24 16 5 9 3 3 1 10 1 5 3 3 1 10 1 5
#> 25 12 5 7 5 3 3 13 1 4 5 3 3 13 1 4
#> 26 15 12 6 2 3 2 7 0 6 2 3 2 7 0 6
#> 27 16 9 2 4 5 1 8 1 7 4 5 1 8 1 7
#> 28 13 6 2 7 5 4 9 1 6 7 5 4 9 1 6
#> 29 2 4 14 0 3 18 0 10 2 0 3 18 0 10 2
#>
#> $lik_rate
#> # A tibble: 29 × 15
#> S1 S2 S3 S4 S5 S6 S7 S8 S9 S10 S11 S12 S13
#> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl>
#> 1 0 0.143 0.857 0.714 0.714 1 0 0.143 1 0.714 0.714 1 0
#> 2 0 0.429 0 0.286 0 0 0.286 0.429 1 0.286 0 0 0.286
#> 3 0 0 0 0.286 0.286 0 0 0.143 0.143 0.286 0.286 0 0
#> 4 0 0.714 0.429 0.429 0.714 0.143 0 0.286 0 0.429 0.714 0.143 0
#> 5 0 0 0.429 0.571 1 0.143 0 0.143 0.714 0.571 1 0.143 0
#> 6 0 0 0.714 0.143 0.429 0.429 0.857 0 0.286 0.143 0.429 0.429 0.857
#> 7 0.429 0.571 0 0.286 0.286 0 0.143 0 0.286 0.286 0.286 0 0.143
#> 8 0 0 0.429 0.429 0 0.429 0 0.143 0.857 0.429 0 0.429 0
#> 9 0 0.286 0.286 0.571 0.571 0.143 0.571 0.143 0.714 0.571 0.571 0.143 0.571
#> 10 0 0 0.286 0.286 0.714 0.429 0 0.429 0.714 0.286 0.714 0.429 0
#> # ℹ 19 more rows
#> # ℹ 2 more variables: S14 <dbl>, S15 <dbl>
#>
#> $lik_sum
#> Mean SD SE.Mean Min Median Max Q1 Q3 Skewness Kurtosis Nobs
#> S1 0.04 0.12 0.02 0 0.00 0.43 0.00 0.00 2.91 5.22 29
#> S2 0.30 0.33 0.06 0 0.14 0.86 0.00 0.57 0.46 -1.58 29
#> S3 0.41 0.35 0.07 0 0.43 1.00 0.00 0.71 0.34 -1.31 29
#> S4 0.47 0.25 0.05 0 0.43 1.00 0.29 0.71 0.27 -0.91 29
#> S5 0.49 0.25 0.05 0 0.43 1.00 0.29 0.71 -0.35 -0.55 29
#> S6 0.31 0.26 0.05 0 0.29 1.00 0.14 0.43 0.80 0.03 29
#> S7 0.20 0.34 0.06 0 0.00 1.00 0.00 0.29 1.56 0.38 29
#> S8 0.18 0.14 0.03 0 0.14 0.43 0.14 0.14 0.82 -0.45 29
#> S9 0.60 0.29 0.05 0 0.71 1.00 0.29 0.86 -0.54 -0.82 29
#> S10 0.47 0.25 0.05 0 0.43 1.00 0.29 0.71 0.27 -0.91 29
#> S11 0.49 0.25 0.05 0 0.43 1.00 0.29 0.71 -0.35 -0.55 29
#> S12 0.31 0.26 0.05 0 0.29 1.00 0.14 0.43 0.80 0.03 29
#> S13 0.20 0.34 0.06 0 0.00 1.00 0.00 0.29 1.56 0.38 29
#> S14 0.18 0.14 0.03 0 0.14 0.43 0.14 0.14 0.82 -0.45 29
#> S15 0.60 0.29 0.05 0 0.71 1.00 0.29 0.86 -0.54 -0.82 29
#>
#> $lik_col
#> [1] 0.54 0.30 0.11 0.29 0.37 0.33 0.20 0.28 0.40 0.36 0.43 0.39 0.26 0.17 0.17
#> [16] 0.42 0.44 0.31 0.53 0.48 0.31 0.42 0.44 0.30 0.42 0.44 0.36 0.51 0.15
#>
relative_likert(garrett_data, Ranks = 9, Option = "sccore")
#> Preliminary check success, proceeding...
#> Likert lenght check success, proceeding...
#> Success, DONE!
#> $lik_num
#> S1 S2 S3 S4 S5 S6 S7 S8 S9 S10 S11 S12 S13 S14 S15
#> 1 10 1 6 5 5 7 11 1 7 5 5 7 11 1 7
#> 2 9 3 13 2 0 14 2 3 7 2 0 14 2 3 7
#> 3 13 9 13 2 2 0 12 1 1 2 2 0 12 1 1
#> 4 16 5 3 3 5 1 9 2 9 3 5 1 9 2 9
#> 5 16 8 3 4 7 1 8 1 5 4 7 1 8 1 5
#> 6 17 16 5 1 3 3 6 0 2 1 3 3 6 0 2
#> 7 3 4 11 2 2 20 1 8 2 2 2 20 1 8 2
#> 8 12 16 3 3 0 3 9 1 6 3 0 3 9 1 6
#> 9 30 2 2 4 4 1 4 1 5 4 4 1 4 1 5
#> 10 15 9 2 2 5 3 9 3 5 2 5 3 9 3 5
#> 11 17 5 6 6 3 2 8 1 5 6 3 2 8 1 5
#> 12 16 6 7 6 2 0 10 1 5 6 2 0 10 1 5
#> 13 19 3 8 1 3 1 11 3 4 1 3 1 11 3 4
#> 14 43 0 2 1 2 2 0 3 0 1 2 2 0 3 0
#> 15 3 42 1 3 0 0 2 0 2 3 0 0 2 0 2
#> 16 17 4 12 5 3 6 1 1 4 5 3 6 1 1 4
#> 17 9 10 6 4 5 2 8 3 6 4 5 2 8 3 6
#> 18 18 8 3 5 5 2 9 1 2 5 5 2 9 1 2
#> 19 11 12 4 6 5 3 6 1 5 6 5 3 6 1 5
#> 20 10 16 4 2 5 4 7 1 4 2 5 4 7 1 4
#> 21 15 10 3 2 5 3 10 1 4 2 5 3 10 1 4
#> 22 21 2 9 3 4 4 4 2 4 3 4 4 4 2 4
#> 23 14 5 7 3 2 4 10 1 7 3 2 4 10 1 7
#> 24 16 5 9 3 3 1 10 1 5 3 3 1 10 1 5
#> 25 12 5 7 5 3 3 13 1 4 5 3 3 13 1 4
#> 26 15 12 6 2 3 2 7 0 6 2 3 2 7 0 6
#> 27 16 9 2 4 5 1 8 1 7 4 5 1 8 1 7
#> 28 13 6 2 7 5 4 9 1 6 7 5 4 9 1 6
#> 29 2 4 14 0 3 18 0 10 2 0 3 18 0 10 2
#>
#> $lik_rate
#> # A tibble: 29 × 15
#> S1 S2 S3 S4 S5 S6 S7 S8 S9 S10 S11 S12 S13
#> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl>
#> 1 0 0.111 0.667 0.556 0.556 0.778 0 0.111 0.778 0.556 0.556 0.778 0
#> 2 1 0.333 0 0.222 0 0 0.222 0.333 0.778 0.222 0 0 0.222
#> 3 0 1 0 0.222 0.222 0 0 0.111 0.111 0.222 0.222 0 0
#> 4 0 0.556 0.333 0.333 0.556 0.111 1 0.222 1 0.333 0.556 0.111 1
#> 5 0 0.889 0.333 0.444 0.778 0.111 0.889 0.111 0.556 0.444 0.778 0.111 0.889
#> 6 0 0 0.556 0.111 0.333 0.333 0.667 0 0.222 0.111 0.333 0.333 0.667
#> 7 0.333 0.444 0 0.222 0.222 0 0.111 0.889 0.222 0.222 0.222 0 0.111
#> 8 0 0 0.333 0.333 0 0.333 1 0.111 0.667 0.333 0 0.333 1
#> 9 0 0.222 0.222 0.444 0.444 0.111 0.444 0.111 0.556 0.444 0.444 0.111 0.444
#> 10 0 1 0.222 0.222 0.556 0.333 1 0.333 0.556 0.222 0.556 0.333 1
#> # ℹ 19 more rows
#> # ℹ 2 more variables: S14 <dbl>, S15 <dbl>
#>
#> $lik_sum
#> Mean SD SE.Mean Min Median Max Q1 Q3 Skewness Kurtosis Nobs
#> S1 0.10 0.27 0.05 0 0.00 1.00 0.00 0.00 2.98 6.09 29
#> S2 0.39 0.35 0.06 0 0.44 1.00 0.00 0.56 0.34 -1.24 29
#> S3 0.42 0.31 0.06 0 0.33 1.00 0.22 0.67 0.30 -1.18 29
#> S4 0.37 0.20 0.04 0 0.33 0.78 0.22 0.56 0.27 -0.91 29
#> S5 0.38 0.19 0.04 0 0.33 0.78 0.22 0.56 -0.35 -0.55 29
#> S6 0.24 0.20 0.04 0 0.22 0.78 0.11 0.33 0.80 0.03 29
#> S7 0.45 0.42 0.08 0 0.44 1.00 0.00 0.89 0.14 -1.81 29
#> S8 0.17 0.17 0.03 0 0.11 0.89 0.11 0.22 2.81 7.84 29
#> S9 0.50 0.23 0.04 0 0.56 1.00 0.44 0.67 -0.22 -0.52 29
#> S10 0.37 0.20 0.04 0 0.33 0.78 0.22 0.56 0.27 -0.91 29
#> S11 0.38 0.19 0.04 0 0.33 0.78 0.22 0.56 -0.35 -0.55 29
#> S12 0.24 0.20 0.04 0 0.22 0.78 0.11 0.33 0.80 0.03 29
#> S13 0.45 0.42 0.08 0 0.44 1.00 0.00 0.89 0.14 -1.81 29
#> S14 0.17 0.17 0.03 0 0.11 0.89 0.11 0.22 2.81 7.84 29
#> S15 0.50 0.23 0.04 0 0.56 1.00 0.44 0.67 -0.22 -0.52 29
#>
#> $lik_col
#> [1] 0.42 0.30 0.16 0.49 0.47 0.26 0.27 0.35 0.31 0.48 0.45 0.30 0.26 0.13 0.13
#> [16] 0.33 0.53 0.44 0.41 0.37 0.24 0.39 0.34 0.30 0.33 0.34 0.47 0.53 0.12
#>
relative_likert(Quicksummary, Ranks = 5, Option = "sccore")
#> Preliminary check success, proceeding...
#> Likert lenght check success, proceeding...
#> Success, DONE!
#> $lik_num
#> # A tibble: 103 × 29
#> `Likert scores 1` `Likert scores 2` `Likert scores 3` `Likert scores 4`
#> <dbl> <dbl> <dbl> <dbl>
#> 1 5 4 4 2
#> 2 5 4 4 2
#> 3 5 4 1 2
#> 4 5 4 4 2
#> 5 5 4 4 2
#> 6 5 4 4 2
#> 7 5 4 4 1
#> 8 5 4 4 2
#> 9 5 4 4 2
#> 10 5 4 4 1
#> # ℹ 93 more rows
#> # ℹ 25 more variables: `Likert scores 5` <dbl>, `Likert scores 6` <dbl>,
#> # `Likert scores 7` <dbl>, `Likert scores 8` <dbl>, `Likert scores 9` <dbl>,
#> # `Likert scores 10` <dbl>, `Likert scores 11` <dbl>,
#> # `Likert scores 12` <dbl>, `Likert scores 13` <dbl>,
#> # `Likert scores 14` <dbl>, `Likert scores 15` <dbl>,
#> # `Likert scores 16` <dbl>, `Likert scores 17` <dbl>, …
#>
#> $lik_rate
#> # A tibble: 103 × 29
#> `Likert scores 1` `Likert scores 2` `Likert scores 3` `Likert scores 4`
#> <dbl> <dbl> <dbl> <dbl>
#> 1 1 0.8 0.8 0.4
#> 2 1 0.8 0.8 0.4
#> 3 1 0.8 0.2 0.4
#> 4 1 0.8 0.8 0.4
#> 5 1 0.8 0.8 0.4
#> 6 1 0.8 0.8 0.4
#> 7 1 0.8 0.8 0.2
#> 8 1 0.8 0.8 0.4
#> 9 1 0.8 0.8 0.4
#> 10 1 0.8 0.8 0.2
#> # ℹ 93 more rows
#> # ℹ 25 more variables: `Likert scores 5` <dbl>, `Likert scores 6` <dbl>,
#> # `Likert scores 7` <dbl>, `Likert scores 8` <dbl>, `Likert scores 9` <dbl>,
#> # `Likert scores 10` <dbl>, `Likert scores 11` <dbl>,
#> # `Likert scores 12` <dbl>, `Likert scores 13` <dbl>,
#> # `Likert scores 14` <dbl>, `Likert scores 15` <dbl>,
#> # `Likert scores 16` <dbl>, `Likert scores 17` <dbl>, …
#>
#> $lik_sum
#> Mean SD SE.Mean Min Median Max Q1 Q3 Skewness Kurtosis
#> Likert scores 1 0.87 0.23 0.02 0.2 1.0 1 0.8 1.0 -1.65 1.27
#> Likert scores 2 0.65 0.31 0.03 0.2 0.8 1 0.4 1.0 -0.33 -1.52
#> Likert scores 3 0.70 0.27 0.03 0.2 0.8 1 0.4 1.0 -0.51 -1.09
#> Likert scores 4 0.63 0.27 0.03 0.2 0.6 1 0.4 0.8 -0.03 -1.31
#> Likert scores 5 0.53 0.25 0.03 0.2 0.6 1 0.4 0.8 0.24 -0.99
#> Likert scores 6 0.55 0.29 0.03 0.2 0.4 1 0.4 0.8 0.28 -1.34
#> Likert scores 7 0.61 0.26 0.03 0.2 0.8 1 0.4 0.8 -0.29 -1.30
#> Likert scores 8 0.57 0.27 0.03 0.2 0.6 1 0.4 0.8 0.02 -1.41
#> Likert scores 9 0.53 0.27 0.03 0.2 0.4 1 0.4 0.8 0.48 -1.06
#> Likert scores 10 0.70 0.30 0.03 0.2 0.8 1 0.4 1.0 -0.51 -1.29
#> Likert scores 11 0.58 0.24 0.02 0.2 0.6 1 0.4 0.8 0.17 -1.02
#> Likert scores 12 0.48 0.25 0.02 0.2 0.4 1 0.2 0.8 0.49 -1.10
#> Likert scores 13 0.59 0.27 0.03 0.2 0.6 1 0.4 0.8 -0.06 -1.32
#> Likert scores 14 0.77 0.27 0.03 0.2 0.8 1 0.6 1.0 -1.01 -0.34
#> Likert scores 15 0.69 0.28 0.03 0.2 0.8 1 0.4 1.0 -0.40 -1.25
#> Likert scores 16 0.59 0.29 0.03 0.2 0.4 1 0.4 0.8 0.25 -1.45
#> Likert scores 17 0.68 0.25 0.02 0.2 0.8 1 0.4 0.8 -0.42 -0.92
#> Likert scores 18 0.65 0.24 0.02 0.2 0.6 1 0.4 0.8 -0.46 -0.79
#> Likert scores 19 0.69 0.25 0.02 0.2 0.8 1 0.4 0.8 -0.45 -1.03
#> Likert scores 20 0.60 0.24 0.02 0.2 0.6 1 0.4 0.8 -0.14 -1.04
#> Likert scores 21 0.61 0.26 0.03 0.2 0.6 1 0.4 0.8 -0.10 -1.25
#> Likert scores 22 0.59 0.26 0.03 0.2 0.6 1 0.4 0.8 -0.08 -1.31
#> Likert scores 23 0.57 0.30 0.03 0.2 0.6 1 0.2 0.8 0.09 -1.51
#> Likert scores 24 0.54 0.26 0.03 0.2 0.4 1 0.4 0.8 0.21 -1.26
#> Likert scores 25 0.58 0.26 0.03 0.2 0.6 1 0.4 0.8 -0.10 -1.31
#> Likert scores 26 0.61 0.24 0.02 0.2 0.6 1 0.4 0.8 -0.12 -1.19
#> Likert scores 27 0.48 0.27 0.03 0.0 0.4 1 0.2 0.8 0.35 -1.17
#> Likert scores 28 0.05 0.17 0.02 0.0 0.0 1 0.0 0.0 3.60 13.15
#> Likert scores 29 0.18 0.36 0.04 0.0 0.0 1 0.0 0.0 1.62 0.71
#> Nobs
#> Likert scores 1 103
#> Likert scores 2 103
#> Likert scores 3 103
#> Likert scores 4 103
#> Likert scores 5 103
#> Likert scores 6 103
#> Likert scores 7 103
#> Likert scores 8 103
#> Likert scores 9 103
#> Likert scores 10 103
#> Likert scores 11 103
#> Likert scores 12 103
#> Likert scores 13 103
#> Likert scores 14 103
#> Likert scores 15 103
#> Likert scores 16 103
#> Likert scores 17 103
#> Likert scores 18 103
#> Likert scores 19 103
#> Likert scores 20 103
#> Likert scores 21 103
#> Likert scores 22 103
#> Likert scores 23 103
#> Likert scores 24 103
#> Likert scores 25 103
#> Likert scores 26 103
#> Likert scores 27 103
#> Likert scores 28 103
#> Likert scores 29 103
#>
#> $lik_col
#> [1] 0.65 0.63 0.62 0.65 0.66 0.67 0.63 0.66 0.66 0.63 0.41 0.41 0.27 0.30 0.37
#> [16] 0.53 0.40 0.19 0.25 0.50 0.83 0.83 0.78 0.52 0.61 0.49 0.66 0.55 0.85 0.59
#> [31] 0.88 0.89 0.66 0.68 0.69 0.65 0.65 0.66 0.64 0.67 0.65 0.66 0.54 0.54 0.56
#> [46] 0.51 0.50 0.54 0.51 0.51 0.52 0.52 0.50 0.54 0.48 0.55 0.45 0.53 0.59 0.54
#> [61] 0.63 0.66 0.62 0.64 0.71 0.72 0.64 0.52 0.43 0.61 0.82 0.65 0.57 0.54 0.54
#> [76] 0.59 0.56 0.69 0.56 0.64 0.66 0.68 0.48 0.66 0.51 0.65 0.44 0.56 0.74 0.57
#> [91] 0.50 0.52 0.49 0.58 0.61 0.55 0.55 0.58 0.58 0.52 0.50 0.48 0.48
#>
library(tidyverse)
data_l <- garrett_data %>%
pivot_longer(cols = everything()) %>%
mutate(value = case_when(value == 5 ~ "Serious constraint",
value == 4 ~ "Constraint",
value == 3 ~ "Not certain it is a constraint",
value == 2 ~ "Not a constraint",
value == 1 ~ "Not a serious constraint",
.default = "None")) %>%
group_by(name) %>%
mutate(row = row_number()) %>%
pivot_wider(names_from = name, values_from = value) %>%
select(-row) %>%
unnest(cols = everything())
ranking <- c("Serious constraint", "Constraint",
"Not certain it is a constraint", "Not a constraint",
"Not a serious constraint")
relative_likert(data_l, Likert = ranking)
#> Preliminary check success, proceeding...
#> Likert lenght check success, proceeding...
#> Success, DONE!
#> $lik_num
#> # A tibble: 29 × 15
#> S1 S2 S3 S4 S5 S6 S7 S8 S9 S10 S11 S12 S13
#> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl>
#> 1 0 5 0 1 1 0 0 5 0 1 1 0 0
#> 2 0 3 0 4 0 0 4 3 0 4 0 0 4
#> 3 0 0 0 4 4 0 0 5 5 4 4 0 0
#> 4 0 1 3 3 1 5 0 4 0 3 1 5 0
#> 5 0 0 3 2 0 5 0 5 1 2 0 5 0
#> 6 0 0 1 5 3 3 0 0 4 5 3 3 0
#> 7 3 2 0 4 4 0 5 0 4 4 4 0 5
#> 8 0 0 3 3 0 3 0 5 0 3 0 3 0
#> 9 0 4 4 2 2 5 2 5 1 2 2 5 2
#> 10 0 0 4 4 1 3 0 3 1 4 1 3 0
#> # ℹ 19 more rows
#> # ℹ 2 more variables: S14 <dbl>, S15 <dbl>
#>
#> $lik_rate
#> # A tibble: 29 × 15
#> S1 S2 S3 S4 S5 S6 S7 S8 S9 S10 S11 S12 S13
#> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl>
#> 1 0 1 0 0.2 0.2 0 0 1 0 0.2 0.2 0 0
#> 2 0 0.6 0 0.8 0 0 0.8 0.6 0 0.8 0 0 0.8
#> 3 0 0 0 0.8 0.8 0 0 1 1 0.8 0.8 0 0
#> 4 0 0.2 0.6 0.6 0.2 1 0 0.8 0 0.6 0.2 1 0
#> 5 0 0 0.6 0.4 0 1 0 1 0.2 0.4 0 1 0
#> 6 0 0 0.2 1 0.6 0.6 0 0 0.8 1 0.6 0.6 0
#> 7 0.6 0.4 0 0.8 0.8 0 1 0 0.8 0.8 0.8 0 1
#> 8 0 0 0.6 0.6 0 0.6 0 1 0 0.6 0 0.6 0
#> 9 0 0.8 0.8 0.4 0.4 1 0.4 1 0.2 0.4 0.4 1 0.4
#> 10 0 0 0.8 0.8 0.2 0.6 0 0.6 0.2 0.8 0.2 0.6 0
#> # ℹ 19 more rows
#> # ℹ 2 more variables: S14 <dbl>, S15 <dbl>
#>
#> $lik_sum
#> Mean SD SE.Mean Min Median Max Q1 Q3 Skewness Kurtosis Nobs
#> S1 0.07 0.21 0.04 0 0.0 0.8 0.0 0.0 2.87 5.06 29
#> S2 0.21 0.30 0.05 0 0.0 1.0 0.0 0.4 1.37 0.29 29
#> S3 0.31 0.36 0.07 0 0.0 1.0 0.0 0.6 0.50 -1.54 29
#> S4 0.50 0.33 0.06 0 0.6 1.0 0.2 0.8 -0.21 -1.32 29
#> S5 0.40 0.28 0.05 0 0.4 0.8 0.2 0.6 0.09 -1.50 29
#> S6 0.52 0.38 0.07 0 0.6 1.0 0.0 0.8 -0.28 -1.44 29
#> S7 0.15 0.32 0.06 0 0.0 1.0 0.0 0.0 1.94 1.43 29
#> S8 0.74 0.38 0.07 0 1.0 1.0 0.6 1.0 -1.28 -0.26 29
#> S9 0.30 0.31 0.06 0 0.2 1.0 0.0 0.4 0.82 -0.80 29
#> S10 0.50 0.33 0.06 0 0.6 1.0 0.2 0.8 -0.21 -1.32 29
#> S11 0.40 0.28 0.05 0 0.4 0.8 0.2 0.6 0.09 -1.50 29
#> S12 0.52 0.38 0.07 0 0.6 1.0 0.0 0.8 -0.28 -1.44 29
#> S13 0.15 0.32 0.06 0 0.0 1.0 0.0 0.0 1.94 1.43 29
#> S14 0.74 0.38 0.07 0 1.0 1.0 0.6 1.0 -1.28 -0.26 29
#> S15 0.30 0.31 0.06 0 0.2 1.0 0.0 0.4 0.82 -0.80 29
#>
#> $lik_col
#> [1] 0.25 0.33 0.48 0.40 0.39 0.41 0.52 0.33 0.56 0.37 0.36 0.27 0.52 0.48 0.40
#> [16] 0.45 0.27 0.44 0.29 0.40 0.44 0.45 0.39 0.47 0.39 0.29 0.40 0.27 0.27
#>