Skip to content

Commit

Permalink
comments fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
markolalovic committed Jun 20, 2024
1 parent e6d008c commit 6e754c6
Show file tree
Hide file tree
Showing 6 changed files with 59 additions and 64 deletions.
9 changes: 2 additions & 7 deletions README.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -30,14 +30,9 @@ The R package **latent2likert** is designed to effectively simulate the discreti
You can install the development version from GitHub with:
```{r, eval = FALSE}
# install.packages("devtools")
#devtools::install_github("markolalovic/latent2likert")
devtools::install_github("markolalovic/latent2likert")
```

```{r, include = FALSE}
devtools::load_all("/Users/markolalovic/dev/latent2likert/")
```


## Dependencies

To keep the package lightweight, **latent2likert** only imports [mvtnorm](https://cran.r-project.org/package=mvtnorm), along with the standard R packages stats and graphics, which are typically included in R releases. An additional suggested dependency is the [sn package](https://cran.r-project.org/package=sn), which is required only for generating random responses from correlated Likert items based on a multivariate skew normal distribution. The package prompts the user to install this dependency during interactive sessions if needed.
Expand All @@ -62,7 +57,7 @@ To keep the package lightweight, **latent2likert** only imports [mvtnorm](https:
To generate a sample of random responses to one item on a 5-point Likert scale, use:

```{r}
#library(latent2likert)
library(latent2likert)
rlikert(size = 10, n_items = 1, n_levels = 5)
```

Expand Down
38 changes: 19 additions & 19 deletions README.html

Large diffs are not rendered by default.

36 changes: 18 additions & 18 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ You can install the development version from GitHub with:

``` r
# install.packages("devtools")
#devtools::install_github("markolalovic/latent2likert")
devtools::install_github("markolalovic/latent2likert")
```

## Dependencies
Expand Down Expand Up @@ -62,9 +62,9 @@ To generate a sample of random responses to one item on a 5-point Likert
scale, use:

``` r
#library(latent2likert)
library(latent2likert)
rlikert(size = 10, n_items = 1, n_levels = 5)
#> [1] 2 4 3 4 5 3 3 3 4 3
#> [1] 4 2 3 2 1 3 2 3 2 3
```

To generate responses to multiple items with specified parameters:
Expand All @@ -77,16 +77,16 @@ rlikert(size = 10,
sd = c(0.8, 1, 1),
corr = 0.5)
#> Y1 Y2 Y3
#> [1,] 3 3 5
#> [2,] 2 1 1
#> [1,] 3 2 6
#> [2,] 2 2 5
#> [3,] 2 2 3
#> [4,] 3 2 5
#> [5,] 2 2 5
#> [6,] 3 2 4
#> [7,] 1 1 3
#> [8,] 3 1 4
#> [9,] 2 2 4
#> [10,] 2 2 4
#> [4,] 3 1 3
#> [5,] 3 1 5
#> [6,] 3 3 6
#> [7,] 4 3 3
#> [8,] 3 3 6
#> [9,] 2 3 3
#> [10,] 3 2 3
```

You can also provide a correlation matrix:
Expand All @@ -110,9 +110,9 @@ these estimates are typically lower:
``` r
cor(data)
#> Y1 Y2 Y3
#> Y1 1.0000000 -0.5271298 -0.3544365
#> Y2 -0.5271298 1.0000000 0.4404984
#> Y3 -0.3544365 0.4404984 1.0000000
#> Y1 1.0000000 -0.5634259 -0.3760927
#> Y2 -0.5634259 1.0000000 0.4362989
#> Y3 -0.3760927 0.4362989 1.0000000
```

## Using `estimate_params`
Expand All @@ -122,9 +122,9 @@ Given the data, you can estimate the values of latent parameters using:
``` r
estimate_params(data, n_levels = c(4, 5, 6), skew = 0)
#> items
#> estimates Y1 Y2 Y3
#> mean 0.02434619 -1.01561017 0.08093401
#> sd 0.77743368 0.97395691 1.05227866
#> estimates Y1 Y2 Y3
#> mean -0.0415071755 -0.9654381812 0.0004640853
#> sd 0.8131470573 0.9995025670 1.0275232490
```

## Transformation
Expand Down
36 changes: 18 additions & 18 deletions docs/index.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/pkgdown.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ pkgdown: 2.0.9
pkgdown_sha: ~
articles:
using_latent2likert: using_latent2likert.html
last_built: 2024-06-20T22:27Z
last_built: 2024-06-20T22:53Z
urls:
reference: https://markolalovic.github.io/latent2likert/reference
article: https://markolalovic.github.io/latent2likert/articles
Expand Down
2 changes: 1 addition & 1 deletion docs/search.json

Large diffs are not rendered by default.

0 comments on commit 6e754c6

Please sign in to comment.