 Santa Tonio Morning

# Posts

### [Manual]Using Jags and R2jags in R

This post is aimed to introduce the basics of using jags in R programming. Jags is a frequently used program for conducting Bayesian statistics.Most of information below is borrowed from Jeromy Anglim’s Blog. I will keep editing this post if I found more resources about jags. What is JAGS? JAGS stands for Just Another Gibbs Sampler. To quote the program author, Martyn Plummer, “It is a program for analysis of Bayesian hierarchical models using Markov Chain Monte Carlo (MCMC) simulation…” It uses a dialect of the BUGS language, similar but a little different to OpenBUGS and WinBUGS.

### Introduce Descrepancy Measures

Descrepancy Measures This Blog is the notes for my recent project about reliability and model checking. Next I want to organize a little about one important concept in model checking - discrepancy measures. Descrepancy Measures $\chi^2$ measures for item-pairs (Chen & Thissen, 1997) $X^2_{jj'}=\sum_{k=0}^{1} \sum_{k'=0}^{1} \frac{(n_{kk'}-E(n_{kk'}))^2}{E(n_{kk'})}$ $G^2$ for item pairs $G^2_{jj'}=-2\sum_{k=0}^{1} \sum_{k'=0}^{1} \ln \frac{E(n_{kk'})}{n_{kk'}}$ model-based covariance (MBC; Reckase, 1997) $COV_{jj'} = \frac{\sum_{i=1}^{N}(X_{ij}-\overline{X_j})(X_{ij'}-\overline{X_{j'}}) }{N} \\ MBC_{jj'} = \frac{\sum_{i=1}^{N}(X_{ij}-E(X_{ij}))(X_{ij'}-E(X_{ij'}))}{N}$

### How to do Data Cleaning in R

Libraries Step 1: Import Data Step 2: Initial Check Step 2.1: check variables step 2.2: check missing values and ranges step 2.3: check first and last cases Step 3: Select and rename Variables Step 4: Remove missing values This blog is trying to elaborate steps for cleaning the data. Since datasets varied, this blog could not cover all. Depedent on the data you’re using, different methods should be used.

### Updating R Version Without missing packages

After updating to new R version (4.5) from old version, you have to re-install all packages by default. However, there’re some solution for that. Unix (MacOs, Linux) 1.Create a new folder in home directory to store the packages. Sometimes, you need to change the permission level for this folder, or R may not have access to write this folder. Rlibs is a special folder where you can store all you packages.

### My New Shiny App Cut Score Consistency

knitr::include_app("https://jihongz.shinyapps.io/Cutscore-1/", height = 1200) 

This post is aimed to remind myself how to write articles with Academic Writing Style. The original article is from http://libguides.usc.edu/writingguide/academicwriting. I. The Big Picture Unlike fiction or journalistic writing, the overall structure of academic writing is formal and logical. It must be cohesive and possess a logically organized flow of ideas; this means that the various parts are connected to form a unified whole. There should be narrative links

### Latent Profile Analysis using MCLUST (in R)

Hi there! This is Jihong. This is a webpage folked from JOSHUA M. ROSENBERG. It aims to provid a very clear example about how to conduct Latent Profile Analysis using MCLUST in r. Import data and load packages library(tidyverse) library(mclust) library(hrbrthemes) # typographic-centric ggplot2 themes data("iris") df <- select(iris, -Species) # 4 variables explore_model_fit <- function(df, n_profiles_range = 1:9, model_names = c("EII", "VVI", "EEE", "VVV")) { x <- mclustBIC(df, G = n_profiles_range, modelNames = model_names) y <- x %>% as.

### Parental Involvement and Children Motivation

One big problem in education study is the longitudinal effect of explanatory factor is always ignored. One of the reasons is the requirements of longitudinal data hardly be met. As a large number of educational studies made used of cross-sectional data to make conclusion, there will be severe issue. For instance, the effect could be positive in one year, however, the effect become smaller and smaller and eventually becomes negative.

### EFA v.s. CFA

Big question I always found exploratory tools and confirmatory tools have distinct fans. The fans of exploratory tools believe the conclusion should be data-driven, nothing else beyond data is needed in order to keep object. On the other hand, some confirmatory fans believe that data could provide nothing without context. Daniel (1988) stated that factor analysis is “designed to examine the covariance structure of a set of variables and to provide an explanation of the relationships among those variables in terms of a smaller number of unobserved latent variables called factors.

### Simulation Study of Linking using mirt

Introduction Calibration of Form A Look at the data Plot the density of true $\theta$ of Group A CTT Table Clean data Classical Test Theory Final Calibration of Form A Model Specification Calibration of Form B Final Calibration of Form A Model Specification of B b-plot a-plot Linking This simulation study is to show how to do IRT Linking Process using mirt R Package.