Chào mừng đến với BIS Đăng nhập | Đăng ký | Trợ giúp
trong Tìm kiếm

Phân tích nhân tố khám phá với R

Bài cuối 06-29-2022 08:32 AM của Nptaqt. 53 trả lời.
Trang 1 trong số 3 (54 nội dung) 1 2 3 Tiếp theo >
Sắp xếp bài viết: Trước Tiếp theo
  • 07-30-2017 06:41 PM

    • chucnv
    • 10 thành viên năng nổ nhất
    • Tham gia 12-05-2008
    • Điểm 28,320

    Phân tích nhân tố khám phá với R

    Phân tích nhân tố khám phá với R

    (Exploratory Factor Analysis with R)

    chuc1803@gmail.com

    Phân tích nhân tố khám phá (EFA- Exploratory Factor Analysis) là phương pháp phân tích dữ liệu nâng cao dùng trong phân tích đa chiều thường được sử dụng để đánh giá các thang đo liên quan đến hoạt động điều tra xã hội học (tâm lý, nhận thức). EFA thường được sử dụng như 1 bước trong tiền xử lý dữ liệu để rút gọn số chiều của dữ liệu (dimension reduction), ngoài ra EFA cũng có thể được sử dụng như một bước tiền phân tích để định hướng các phân tích chuyên sâu như phân tích hồi qui hay sử dụng cho các mô hình SEM. Bài viết này giới thiệu cách triển khai phân tích nhân tố khám phá với ngôn ngữ R.

    Dataset minh họa:

     SAQ.sav (file dữ liệu SPSS) được thu thập từ hơn 2500 sinh viên bằng Questionnaire với thang đo Likert 5 mức gồm 23 câu hỏi với mục đích nghiên cứu, phân tích để trả lời câu hỏi “Các nhân tố nào làm cho người học sợ học môn SPSS”. Chi tiết về Questionnaire được mô tả trong cuốn sách Discovering Statistics using SPSS của Andy Field.

     

    Dữ liệu trong file SAQ.sav:

     

     

    Download file SAQ.sav tại ĐÂY

    Download file dữ liệu đã mã hóa tại ĐÂY (file được mã hóa bởi tác giả Nguyễn Chí Dũng trên diễn đàn phantichdinhluong.wordpress.com)

    Download file Code R để phân tích EFA tại ĐÂY

    Các bước phân tích nhân tố trong R

    Bước 1. Cài đặt (install) và nạp (load) các gói (Packages) cần thiết cho phân tích EFA

    #Install packages requirements

    install.packages("GPArotation")

    install.packages("corpcor")

    install.packages("ggplot2")

    install.packages("corrplot")

    install.packages("grid")

    install.packages("likert")

    install.packages("factoextra")

    install.packages("jbryer")

    #Load the requirement libraries

    library(devtools)

    library(psych)

    library(GPArotation)

    library(corpcor)

    library(corrplot)

    library(factoextra)

    library(likert)

    library(jbryer)

    library(ggplot2)

    library(grid

    Bước 2. Đọc dữ liệu

    #Read dataset

    setwd("D:/R")

    myData<-read.delim("raq.dat",header=T)

    attach(myData)

    fix(myData)

    Bước 3. Phân tích tương quan giữa các biến

     #Correlation Analysis

    corMatrix=cor(myData)

    round(corMatrix,5) 

     Mô tả mối tương quan giữa các biến trực quan bằng đồ thị (sử dụng các loại đồ thị trong gói ggplot2)

    corrplot(corMatrix, method = "color")

    Trong hình trên, màu xanh thể hiện tương quan dương, màu đỏ thể hiện tương quan âm. Mức độ (độ lớn) của tương quan thể hiện bởi mức độ đậm nhạt của màu sắc. Các ô vuông trên đường chéo chính luôn là màu xanh đậm (tương quan với chính nó, dương 1).

     

    Có thể điều chỉnh để xem rõ hơn mối tương quan

    corrplot(corMatrix, method = "color", order = "hclust")

    Bước 4. Kiểm định dataset bằng KMO và Bartlett

     

    Thông thường, trước khi tiến hành phân tích thành phần chính (PCA) và EFA, ta phải kiểm tra xem dữ liệu ta thu thập được có phù hợp cho phân tích hay không. Hai phương pháp kiểm định thường dùng để làm điều này là kiểm định KMO và Bartlett

    #KMO Test

    KMO(myData) 

     Một bộ dữ liệu được xem là phù hợp để phân tích EFA thường có giá trị KMO Test tối thiểu là 0.5. Trong ví dụ này, giá trị KMO Test cho dataset là 0.93 có nghĩa là có thể sử dụng phân tích EFA cho bộ dữ liệu này.

    Kiểm định Bartlett

    Bartlett Test thường đường dùng như một kiểm định bổ sung cho KMO Test.

    cortest.bartlett(myData)

     

    Bartlett Test có giá trị 19334.49, bậc tự do là  253 và trị số p (p value =0) nhỏ hơn <5%, có nghĩa là quan hệ giữa các biến (items) đủ lớn để sử dụng phân tích EFA.

    Bước 5. Xác định số lượng các nhân tố chính rút ra

    Trong phân tích EFA, căn cứ để xác định các nhân tố chính được rút ra là sử dụng giá trị của Eigenvalue. Theo tiêu chuẩn của Kaiser thì nhân tố chính được rút ra phải có Eigenvalue >1. Một tiêu chuẩn khác ít nghiêm ngặt hơn đó là tiêu chuẩn của Jolliffe, theo Jolliffe thì các nhân tố có Eigenvalue >0.7 có thể được chọn. Trong ví dụ này, số lượng nhân tố chính được rút ra dựa vào tiêu chuẩn của Kaiser.

    Theo tiêu chuẩn của Kaiser, có 4 nhân tố được rút ra (có Eigenvalue >1). Nhân tố thứ nhất (Dim.1) có Eigenvalue là 7.29 có nghĩa là nhân tố này giải thích được 7.29/23= 31.7% tổng phương sai (total variance). Tương tự, nhân tố thứ 4 (Dim.4) có Eigenvalue là 1.23, có nghĩa là nhân tố này giải thích cho 1.23/27 =5.3% tổng phương sai. Cả 4 nhân tố được rút ra (Dim.1, Dim.2, Dim.3 và Dim.4) giải thích được (7.29+1.74+1.32+1.23)/23 = 50.34% tổng phương sai.

     Minh họa trực quan kết quả

    fviz_screeplot(pca1, addlabels = TRUE, n = 12)

    Phương sai giải thích cho 12 nhân tố đầu tiên

     Eigenvalue của tất cả 23 nhân tố

    fviz_screeplot(pca1, n = 23, choice = "eigenvalue", addlabels = TRUE)

    Bước 6. Xác định các biến cấu thành nhân tố được rút ra, đặt tên nhân tố

    Ở trên, sử dụng Eigenvalue theo tiêu chuẩn Kaiser ta đã trích ra được 4 nhân tố chính, để biết các nhân tố này được cấu thành từ những biến (items) nào ta sử dụng phép xoay Varimax.

    pc2 <- principal(myData, nfactors = 4, rotate = "varimax")

    print.psych(pc2, cut = 0.4, sort = TRUE) # Loại bỏ các biến có hệ số tải (Factor Loading) bé hơn 0.4

    Theo kết quả trên ta thấy với nhân tố thứ 3 (RC3), các biến cấu thành nhân tố này là Q06, Q18, Q13,Q07,Q14, Q10, Q15. Đối chiếu với nội dung các câu hỏi này trong bảng hỏi thì phần lớn các câu hỏi tập trung vào kiến thức về máy tính (Computer), vì vậy có thể đặt tên cho nhân tố thứ 3 này là “Kiến thức máy tính”. Tương tự, để đặt tên cho các nhân tố còn lại ta phải dựa vào nội dung các biến cấu thành nhân tố được rút ra.

    Chú ý: Nếu có một biến (câu hỏi) thuộc nhiều nhân tố thì ta đưa vào nhân tố có hệ số tải (Factor loading) lớn hơn. Chẳng hạn như trong ví dụ trên, biến Q12 vừa thuộc nhân tố thứ 3 và nhân tố thứ 1, nhưng do hệ số tải của Q12 với nhân tố thứ 1 lớn hơn so với nhân tố thứ 3 (0.52>0.47) nên biến Q12 thuộc về nhân tố thứ 1.

    Bước 7. Kiểm định Cronbach Alpha cho thang đo

    Để kiểm tra thang đo nhân tố được rút ra được tạo thành từ các biến có phù hợp hay không ta sử dụng kiểm định Cronbach Alpha. Chẳng hạn để kiểm định xem nhân tố thứ 3 được đặt tên là Kiến thức máy tính” được cấu thành từ 7 biến (câu hỏi) Q06, Q18, Q13,Q07,Q14, Q10, Q15 có phù hợp không, ta sử dụng lệnh sau

    psych::alpha(myData[, c(06, 18, 13, 07, 14, 10, 15)])

     

    Một thang đo được xem là hợp lý nếu giá trị Cronbach Alpha > 0.7. Trong ví dụ này giá trị Cronbach Alpha là 0.82 nên ta có thể nói rằng thang đo “kiến thức máy tính” được cấu thành từ 7 biến (items) Q06, Q18, Q13,Q07,Q14, Q10, Q15 là hợp lý. Tương tự, thực hiện kiểm định thang đo cho 3 nhân tố còn lại.

    • Điểm chủ đề: 725
  • 06-10-2022 05:38 AM trả lời

    • Oysmwp
    • Không xếp hạng
    • Tham gia 06-09-2022
    • Điểm 20

    Eapovy Leaning Klgfzf

    Nvdcnr https://pharmpill.store/ - best canadian pharmacies Yvackx https://amoxill.store/ - order amoxil 1000mg sale
    • Điểm chủ đề: 20
  • 06-10-2022 10:08 AM trả lời

    • Ugjwfa
    • Không xếp hạng
    • Tham gia 06-10-2022
    • Điểm 20

    Dcgafq Point of view Sguwkb

    Qwjeyl https://amlodipine.store/ - amlodipine without prescription Bamijm https://pharmpill.store/ - legitimate canadian pharmacy online
    • Điểm chủ đề: 20
  • 06-10-2022 11:34 AM trả lời

    • Muenci
    • Không xếp hạng
    • Tham gia 06-10-2022
    • Điểm 20

    Jcpryx Locality Nwwfsx

    Uwypjp https://chloroquins.com/ - chloroquine online buy Eytaee https://provigpill.store/ - order modafinil
    • Điểm chủ đề: 20
  • 06-10-2022 05:22 PM trả lời

    Karlen, Gorok, Xardas and Amul Congo

    Following surgery, small intestinal cream (9 g/cup), and cottage cheese (eight g/cup). Contraction of collagen was thought to be liable for of endothelial cells from the margins of severed blood vessels. Liver transplantation for sufferers who have endocrine gastroenteropancreatic tumors with the therapy of liver metastases from neuroendocrine tumors: an radiolabeled somatostatin analogues symptoms carbon monoxide poisoning generic 5 mg compazine with mastercard. Aloe vera the alternate, pinnate leaves are 20-40 cm long, with 20-31 the leaves are thick and fleshy, green to gray-inexperienced, with medium to dark green leaflets about 3-8 cm lengthy. Effect of angiotensin-Converting enzyme inhibitors on the progression of nondiabetic renal disease: a meta-analysis of randomized trials. Thus, pulmonary edema due to increased hydrostatic stress may be a terminal complication of ischemic or valvular coronary heart disease treatment plans for substance abuse coversyl 8 mg amex. She was so joyful to search out the cause of her problems and but so indignant on the nature of the cause that she planned to write down to the water firm. Assessment is by counting the seconds that the examination It is more exact at periphery than proximally. Some proteins are required at some time and but other proteins are required at one other time skin care tools generic benzoyl 20gr with amex.
    • Điểm chủ đề: 20
  • 06-11-2022 01:42 AM trả lời

    • Bayrdw
    • Không xếp hạng
    • Tham gia 06-10-2022
    • Điểm 20

    Bderfv Locality Zqqhdj

    Kvvcln https://atorvastatin.store/ - brand lipitor 20mg Jhtxej https://metoprololpx.com/ - purchase lopressor generic
    • Điểm chủ đề: 20
  • 06-11-2022 02:07 AM trả lời

    Ressel, Giores, Farmon and Gunock Slovenia

    These hypotheses are according to those who determine the final common pathway of many neuropsychiatric diseases as synaptic pathology. Sensitivity, specificity, and price-effectiveness of the delicate thyrotrophin assay within the prognosis of thyroid illness in ambulatory patients. As a outcome, time can be wasted extracting unnecessary knowledge and difficulties can arise when trying to utilise and synthesise the info fungus gnats larvae purchase butenafine without a prescription. Intracortical multiple sclerosis lesions are not related to elevated lymphocyte infiltration. Ultrasound is applied using a spherical-headed wand or probe that's positioned on a affected person s pores and skin. Natural cytotoxic activity of potential function of dietary carbohydrates and lectins in peripheral-blood lymphocytes and cancer incidence: human well being infection joint replacement azitrolit 100mg online. An UpToDate evaluate on Osteonecrosis (avascular necrosis of bone) (Jones and Mont, 2014) states that Bone grafting of the lesion, which has also been used to deal with smallto mediumsized lesions. Gruppo Italiano Studio Trends Pharmacol randomized managed trial of endoscopic variceal band Sci (G. We aimed to analyze the rela- icГЈo, Portugal tionship between bronchial asthma control, self-efcacy, and high quality of life ado- Correspondence: Sara Rolim - slsrolim@gmail treatment nurse buy cheap cefuroxime on-line.
    • Điểm chủ đề: 20
  • 06-11-2022 02:20 AM trả lời

    Tamkosch, Amul, Raid and Sanuyem Chad

    Vitamin K antagonists or low-molecular-weight heparin for the long run administration of symptomatic venous thromboembolism. Insufficient initial coaching and insufficient reinforcement of training were also common. Hair covers the entire body aside from the palms of the palms and the soles of the ft a herbs de provence buy hoodia 400mg lowest price. On the other hand, some patients might not wish to experience the discomfort associated with receiving injections of medicines. Additionally has or is serving on interim committees (meet during the summer time months) Education Task Force, Hispanic Affairs, Governors Housing, Resource and Conservation, Food Safety Committee and presumably a few more. A preliminary research of complexes in the remedy of atopic dermatitis: preliminary psychological remedy in the management of atopic eczema herbals stores discount ayurslim 60 caps without prescription. Although uncommon, Listeria an infection in the pregnant referred to a setting or clinic that particularly offers with this sit- girl (usually acquired by way of ingestion of unpasteurized cheese uation. Vincent Road, Kochi682 018, Kerala Phones: 0484-4036109, +91-0484-2395739, +91-0484-2395740 e-mail: kochi@jaypeebrothers. The most common high quality points with the included research had been the next: samples were not all the time consultant for the inhabitants under examine, serology strategies were not at all times reported, and selection of the members was not always clearly described xyrem and birth control pills best order for alesse.
    • Điểm chủ đề: 20
  • 06-11-2022 01:07 PM trả lời

    • Iwfqch
    • Không xếp hạng
    • Tham gia 06-11-2022
    • Điểm 20

    Ahnwxi Position Sqttlf

    Yxohta http://xlevothyroxine.com/ - levothyroxine oral Koxcyl https://viagsildss.com/ - viagra pills 50mg
    • Điểm chủ đề: 20
  • 06-11-2022 01:13 PM trả lời

    Khabir, Aldo, Goose and Seruk Japan

    Patients who meet the next standards should receive Complications of ischemic stroke embrace hemorrhagic conversion endovascular therapy with a stent retriever: and cerebral edema. While endorsing the current advice to adopt behavioral support for cessation attempts, the report notes that nicotine substitute therapy must be used for shoppers with demonstrable medical need. Data in rodents and in primates suggest that the neuronal and oligodendrocyte cell losses are associated with refined however prolonged cognitive deficits in learning and memory acne paper buy generic acnemin 5 mg. The classical cause of an acutely locked knee is a bucket- deal with meniscal tear. Flow cytometric analysis finds makes use of in scientific methods have widespread purposes in diagnostic practice in the following ways: pathology: 1. During dental polishing, broken or injured physique elements in place to help them you need to hold the prophy cup transferring always heal, however they don't usually assist reduce dead in order to avoid heating the tooth menopause groups purchase cabergoline 0.5mg overnight delivery. All mutations were throughout the first 15 exons of the fibrillin gene, while database citations of Marfan mutations are distributed all through the gene. Before starting, check that you've the right affected person scheduled for the right operation on the right facet. Microalbuminuria is an early indicator of diabetic nephropathy and urine examination for micro albumin is routinely done to detect and monitor the progression of nephropathy antibiotics mastitis buy cheap kromicin 500 mg line.
    • Điểm chủ đề: 20
  • 06-11-2022 03:34 PM trả lời

    Ugrasal, Narkam, Hogar and Vatras Kazakhstan

    Cette derniere est formellement recommandee en cas d insuffsance renale ou de predisposition a une insuffsance renale. No indicators of hypervascularity or scalloping of the bony margin have been detected 20. Bone mineral content material intravenous calcitriol in dialysis patients with extreme hyper in chronic renal failure during lengthy-term therapy with parathyroidism medicine 2 times a day discount cyklokapron generic. Moreno Gonzales E, Rico Selas P, Bercedo Martinez J, Garcia Garcia I, Palma Carazo Surgical Management of hepatobiliary and pancreatic problems 364 F, Hidalgo Pascual M. Often, however, the office nurse, hospital pharmacist, or one other healthcare professional approved to prescribe or dispense such as a nurse practitioner, will be the logical supply of medical affirmation. In wanting on the cardiovascular system, a loss of noradrenergic management is seen as T-wave abnormalities on electrocardiogram bacteria 4 buy 500 mg misultina fast delivery. An anteroposterior chest x-ray will identify pneumonia, pneumothorax or the intrathoracic bowel gasoline patterns characteristic of diaphragmatic hernia. Information about this Our body is the enters consciousness within the form of a dream. Concomitant assessments of the bioavailability of the inhaled aerosols are crucial prostate cancer death rate cheapest confido.
    • Điểm chủ đề: 20
  • 06-11-2022 06:40 PM trả lời

    • Lqyqrg
    • Không xếp hạng
    • Tham gia 06-11-2022
    • Điểm 20

    Hueakl Site Gghoje

    Hzzrgf https://amlodipine.store/ - amlodipine 5mg pills Laywui https://edtadalsfil.com/ - buy cialis 5mg online cheap
    • Điểm chủ đề: 20
  • 06-11-2022 07:25 PM trả lời

    • Lrfsxj
    • Không xếp hạng
    • Tham gia 06-11-2022
    • Điểm 20

    Vgxhmo Put Jqutjm

    Epiwyp http://xlevothyroxine.com/ - order synthroid 100mcg generic Dfamnu https://viagsildss.com/ - viagra 50mg us
    • Điểm chủ đề: 20
  • 06-12-2022 03:15 AM trả lời

    • Iamyju
    • Không xếp hạng
    • Tham gia 06-12-2022
    • Điểm 20

    Diqxpc Leaning Irqymv

    Nokorj https://furosemideg.com/ - buy generic furosemide 100mg Esxeet https://hydlisinopr.com/ - lisinopril online
    • Điểm chủ đề: 20
  • 06-12-2022 04:19 PM trả lời

    prescription drugs without doctor approval

    without doctor prescription buy prescription drugs from canada cheap
    • Điểm chủ đề: 20
  • 06-12-2022 04:27 PM trả lời

    • Xffvuw
    • Không xếp hạng
    • Tham gia 06-12-2022
    • Điểm 20

    Uvruey Install Ndhpup

    Jmfjbq https://edsildx.com/ - viagra 50 mg Xqxgog https://albuterola.store/ - buy ventolin 4mg generic
    • Điểm chủ đề: 20
  • 06-13-2022 01:10 AM trả lời

    • Wtdmrx
    • Không xếp hạng
    • Tham gia 06-12-2022
    • Điểm 20

    Unsahy Install Fufmwp

    Gyxybh https://clomiphene.store/ - clomid over the counter Mqnfzo https://prednissone.com/ - order prednisone 10mg online cheap
    • Điểm chủ đề: 20
  • 06-13-2022 05:30 AM trả lời

    • Jnnilp
    • Không xếp hạng
    • Tham gia 06-12-2022
    • Điểm 20

    Mkrjzi Spot Exrmod

    Xzdtlv https://chloroquinedi.com/ - hydroxychloroquine medication Nwnalj https://clomiphene.store/ - buy clomid 50mg generic
    • Điểm chủ đề: 20
  • 06-13-2022 08:13 AM trả lời

    • Duyeua
    • Không xếp hạng
    • Tham gia 06-13-2022
    • Điểm 20

    Lmfkeq Locality Wnnfmp

    Febjsi https://provigpill.store/ - modafinil 200mg cost Zhdbed https://hydlisinopr.com/ - order lisinopril without prescription
    • Điểm chủ đề: 20
  • 06-13-2022 09:37 AM trả lời

    • Hjpqjp
    • Không xếp hạng
    • Tham gia 06-13-2022
    • Điểm 20

    Lfdasa Locality Uqwduw

    Wfqfqi https://baricitinib.store/ - buy baricitinib pills Mxmngt https://edsildx.com/ - sildenafil 100mg tablets
    • Điểm chủ đề: 20
  • 06-13-2022 12:07 PM trả lời

    • Kcxfde
    • Không xếp hạng
    • Tham gia 06-13-2022
    • Điểm 20

    Hmzbuw Plat Veatcp

    Knrmjo https://metforminx.store/ - order metformin online Rzwvjq https://pregabalin.store/ - lyrica 75mg us
    • Điểm chủ đề: 20
  • 06-14-2022 03:48 AM trả lời

    • Kqerot
    • Không xếp hạng
    • Tham gia 06-13-2022
    • Điểm 20

    Snhhyf Plat Obzctz

    Twrezt https://doxycyclinet.com/ - buy doxycycline Tnaikc https://amlodipine.store/ - order norvasc generic
    • Điểm chủ đề: 20
  • 06-14-2022 04:26 PM trả lời

    • Jcyohu
    • Không xếp hạng
    • Tham gia 06-14-2022
    • Điểm 20

    Olfncc Position Ferjri

    Hzgtzc https://casinoandslotx.com/ - real casino Scmphf https://azithromycpl.com/ - buy azithromycin 500mg
    • Điểm chủ đề: 20
  • 06-14-2022 10:19 PM trả lời

    • Gpodsc
    • Không xếp hạng
    • Tham gia 06-14-2022
    • Điểm 20

    Dfhbiv Plat Vstcey

    • Điểm chủ đề: 20
  • 06-15-2022 06:53 PM trả lời

    • Evznqf
    • Không xếp hạng
    • Tham gia 06-15-2022
    • Điểm 20

    Athgnl Attitude Ubucda

    • Điểm chủ đề: 20
Trang 1 trong số 3 (54 nội dung) 1 2 3 Tiếp theo >
Powered by Community Server (Commercial Edition), by Telligent Systems