“Look deep into nature, and then you will understand everything better.” - Albert Einstein
Data is data frame
model is the lavaan model syntax character variable
fit is an object of class lavaan typically returned from functions cfa, sem, growth, and lavaan
m1_fit and m2_fit are used for showing model comparison of lavaan objects.
Introduction: http://users.ugent.be/~yrosseel/lavaan/lavaanIntroduction.pdf
Basic model commmands: ?cfa ?sem ?lavaan:
Extracting elements: ?inspect
Name Command fit CFA to data cfa(model, data=Data) fit SEM to data sem(model, data=Data) standardised solution sem(model, data=Data, std.ov=TRUE) orthogonal factors cfa(model, data=Data, orthogonal=TRUE)
Name Command Factor covariance matrix inspect(fit, "coefficients")$psi Fitted covariance matrix fitted(fit)$cov Observed covariance matrix inspect(fit, 'sampstat')$cov Residual covariance matrix resid(fit)$cov Factor correlation matrix cov2cor(inspect(fit, "coefficients")$psi) or use covariance command with standardised solution e.g., cfa(..., std.ov=TRUE)
Name Command Fit measures: fitMeasures(fit) Specific fit measures e.g.: fitMeasures(fit)[c('chisq', 'df', 'pvalue', 'cfi', 'rmsea', 'srmr')]
Name Command Parameter information parTable(fit) Standardised estimates standardizedSolution(fit) or summary(fit, standardized=TRUE)
R-squared | inspect(fit, 'r2')
Name Command Compare fit measures cbind(m1=inspect(m1_fit, 'fit.measures'), m2=inspect(m2_fit, 'fit.measures')) Chi-square difference test anova(m1_fit, m2_fit)
Name Command Modification indices mod_ind <- modificationindices(fit) 10 greatest head(mod_ind[order(mod_ind$mi, decreasing=TRUE), ], 10) mi > 5 subset(mod_ind[order(mod_ind$mi, decreasing=TRUE), ], mi > 5)
Hoàn khố bất ngạ tử Nho quan đa ngộ thân. - 紈褲不餓死 儒冠多誤身.
Đỗ Phủ, Phụng tặng Vi Tả Thừa (杜甫, 奉贈韋左丞)
Gá thân mộng, Dạo cảnh mộng. Mộng tan rồi, Cười vỡ mộng. Ghi lời mộng, Nhắn khách mộng. Biết được mộng, Tỉnh cơn mộng.
Thích Thanh Từ, Mộng (07.1980)
When you know illusion, you will immediately be free. Freedom from illusion is in itself enlightenment. - Tri huyễn tức ly. Ly huyễn tức giác.
Phật, Kinh Viên Giác (Buddha, The Sutra of Perfect Enlightenment)
Biết nó là giả (huyễn) bèn ly cái khổ. Ly được cái huyễn tức là người giác ngộ.
The wise delight in water; the benevolent delight in mountains. The wise take action; the benevolent remain still. The wise are joyful; the benevolent are long-lived. - “Trí giả nhạo thủy, nhân giả nhạo sơn. Trí giả động, nhân giả tĩnh. Trí giả lạc, nhân giả thọ.” - “知者乐水,仁者好山; 智者欲发,仁者静; 智者乐,仁者寿。
Confucius / Khổng Tử / 子曰
“If Bach is not in Heaven, I am not going!” William F. Buckley, Jr.
Waking up this morning, I smile. Twenty-four brand new hours are before me. I vow to live fully in each moment and to look at all beings with eyes of compassion. - Thức dậy miệng mỉm cười. Hăm bốn giờ tinh khôi. Xin nguyện sống trọn vẹn, Mắt thương nhìn cuộc đời.
Thich Nhat Hanh