-
Notifications
You must be signed in to change notification settings - Fork 0
/
README.Rmd
87 lines (61 loc) · 3.08 KB
/
README.Rmd
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
80
81
82
83
84
85
86
87
---
output: github_document
---
<!-- README.md is generated from README.Rmd. Please edit that file -->
```{r, include = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
fig.path = "man/figures/README-",
out.width = "100%"
)
```
# HCL-32 Psychometric Properties <a href='https://github.com/brunomontezano/HCLpsychometrics/'><img src='man/figures/logo.png' align="right" height="139" /></a>
<!-- badges: start -->
[![R-CMD-check](https://github.com/brunomontezano/HCLpsychometrics/workflows/R-CMD-check/badge.svg)](https://github.com/brunomontezano/HCLpsychometrics/actions)
<!-- badges: end -->
The objective of `HCLpsychometrics` is to provide functions to perform the analyzes used in a study on the factor structure of the HCL-32 instrument in a population sample. The package has functions for executing routines for confirmatory factor analysis and Cronbach's alpha
coefficient estimation.
#### Note
This repository is not intended to be used by others. It is a package aggregating several tools used to replicate the specific analysis of an article. The dataset named `hcl` inside the package contains an example tibble (10% of the original sample) to check the proper functioning and give an idea on how the package works.
## Installation
The current version can be installed from
[GitHub](https://github.com/) with:
``` r
# install.packages("remotes")
remotes::install_github("brunomontezano/HCLpsychometrics")
```
## Examples
### Confirmatory Factor Analysis
```{r}
library(HCLpsychometrics)
# First, the models to be tested are created
created_models <- create_models()
# Then, we can fit these models on given dataset
# that contains yX as variable names, X being numbers from 1 to 32
fitted_models <- fit_models(
data = hcl,
models = created_models
)
# Finally, I could for example, summarize the parameters
# (In this case, I just printed the first 3 rows to save space)
summarize_parameters(
fits = fitted_models
) %>% purrr::map(head, 3)
```
As can be seen from the output of the functions, they work in order to fit three models for CFA: a model by Bech et al. (2011), another by Forty et al. (2010) and a third model called HCL-28, developed by the authors of the paper.
Note that the `summarize_fit` and `summarize_parameters` functions' outputs are returned as an R list, facilitating the individual check of the results of each model through the elements in this list.
### Cronbach's Alpha
```{r}
# The alpha_hcl28 function can be used to calculate Cronbach's
# alpha based on the HCL-28 model in the input dataset
HCLpsychometrics::alpha_hcl28(hcl)
```
As you can see from the output, the `alpha_hcl28` function generates
Cronbach's alpha for the structure (HCL-28) as a whole, and separately
by factor.
## Acknowledgement
I would like to thank designer [Guilherme Bueno](https://guilhermebuenodesign.github.io/) for creating the repository logo.
Logo icon adapted from [Freepik](https://www.freepik.com/).
## Contact
Feel free to contact me here on [GitHub](https://github.com/brunomontezano) or [ResearchGate](https://www.researchgate.net/profile/Bruno-Braga-Montezano).