0

是否可以将图例中项目的出现顺序与图中观察到的变量的出现顺序相匹配?在下图中,观察到的变量是顶部的 Q2 和底部的 Q19。在图例中,项目是顶部的 Q19 和底部的 Q2。我喜欢在图例和图中将 Q2 放在顶部,Q19 放在底部。

我尝试更改 manifests=paste0("Q",10:1) 和 reorder=TRUE。没有工作。

在此处输入图像描述

library(semPlot)

nodeNames <- c(
    "I focus harder on the text when I have trouble understanding.", # Q2
    "When my mind wanders, I recover my concentration right away.", # Q6
  "I try to get back on track when I lose concentration.", # Q12
  "When I have difficulty understanding what I hear, I give up and stop listening.", # Q16
  "I translate in my head as I listen.", # Q4
  "I translate key words as I listen.", # Q11
  "I translate word by word, as I listen.", # Q18
  "I find that listening in French is more difficult than reading, speaking, or writing in French.", # Q3
  "I feel that listening comprehension in French is a challenge for me.", # Q8
  "I don’t feel nervous when I listen to French.", # Q15
  "Before I start to listen, I have a plan in my head for how I am going to listen.", # Q1
  "Before listening, I think of similar texts that I may have listened to.", # Q10  
  "After listening, I think back to how I listened, and about what I might do differently next time.", # Q14
  "As I listen, I periodically ask myself if I am satisfied with my level of comprehension.", # Q20
  "I have a goal in mind as I listen.", # Q21
  "I use the words I understand to guess the meaning of the words I don’t understand.", # Q5
  "As I listen, I compare what I understand with what I know about the topic.", # Q7
  "I use my experience and knowledge to help me understand.", # Q9
  "As I listen, I quickly adjust my interpretation if I realize that it is not correct.", # Q13  
  "I use the general idea of the text to help me guess the meaning of the words that I don’t understand.", # Q17
  "When I guess the meaning of a word, I think back to everything else that I have heard, to see if my guess makes sense.", # Q19
  "Problem solving",
  "Planning and evaluation",
  "Person knowledge",
  "Mental translation",
  "Directed attention"
)

model2 <- "
Problem solving =~ '.66'*Q19 + '.65'*Q17 + '.53'*Q13 + '.64'*Q9 + '.62'*Q7 + '.59'*Q5
Planning and evaluation =~ '.63'*Q21 + '.56'*Q20 + '.56'*Q14 + '.59'*Q10 + '.66'*Q1
Person knowledge =~ '-.68'*Q15 + '.77'*Q8 + '.62'*Q3
Mental translation =~ '.69'*Q18 + '.71'*Q11 + '.89'*Q4
Directed attention =~ '-.40'*Q16 + '.67'*Q12 + '.69'*Q6 + '.74'*Q2

Problem solving ~~ Planning and evaluation
Problem solving ~~ Mental translation
Problem solving ~~ Directed attention
Problem solving ~~ Person knowledge
Planning and evaluation ~~ Mental translation
Planning and evaluation ~~ Directed attention
Planning and evaluation ~~ Person knowledge
Mental translation ~~ Directed attention
Mental translation ~~ Person knowledge
Directed attention ~~ Person knowledge
"
plot(model2,
     reorder=FALSE, # Disable the default reordering
     nodeNames=nodeNames, # Add a legend with node names
     legend.cex=0.35, # Make the legend smaller
     rotation=2, # Rotate the plot
     layout="tree2",
     sizeMan=4, # Set the size of manifest variables
     sizeLat=8, # Set the size of latent variables
     edge.label.cex=0.6,
     mar = c(2,5,2,5.5), # Figure margins
     filetype = "pdf", width = 15, height = 15, filename = "Figure1" # Save to PDF
      )
4

0 回答 0