[R] Path Diagram

John Fox jfox at mcmaster.ca
Tue Apr 16 20:33:21 CEST 2013


Dear Laura,

This works for me. Is dot on your system path?

Best,
 John

-----------------------------------------------
John Fox
Senator McMaster Professor of Social Statistics
Department of Sociology
McMaster University
Hamilton, Ontario, Canada




> -----Original Message-----
> From: r-help-bounces at r-project.org [mailto:r-help-bounces at r-
> project.org] On Behalf Of Laura Thomas
> Sent: Tuesday, April 16, 2013 1:17 PM
> To: r-help at r-project.org
> Subject: [R] Path Diagram
> 
> Hi All,
> 
> Apologies if this has been answered somewhere else, but I have been
> searching for an answer all day and not been able to find one.
> 
> I am trying to plot a path diagram for a CFA I have run, I have
> installed
> Rgraphviz and run the following:
> 
> pathDiagram(cfa, min.rank='item1, item2, item3, item4, item5, item6,
> item7, item8, item9, item10, item11, item12', max.rank='SMP, AAAS',
> file='documents')
> 
> I get the following message and output:
> 
> Running  dot -Tpdf -o documents.pdf  documents.dot
> 
> digraph "cfa" {
>   rankdir=LR;
>   size="8,8";
>   node [fontname="Helvetica" fontsize=14 shape=box];
>   edge [fontname="Helvetica" fontsize=10];
>   center=1;
>   {rank=min "item1" "item2" "item3" "item4" "item5" "item6" "item7"
> "item8" "item9" "item10" "item11" "item12"}
>   {rank=max "SMP" "AAAS"}
>   "SMP" [shape=ellipse]
>   "AAAS" [shape=ellipse]
>   "SMP" -> "item1" [label="smp0"];
>   "SMP" -> "item3" [label="smp1"];
>   "SMP" -> "item4" [label="smp2"];
>   "SMP" -> "item6" [label="smp3"];
>   "SMP" -> "item8" [label="smp4"];
>   "SMP" -> "item10" [label="smp5"];
>   "SMP" -> "item11" [label="smp6"];
>   "AAAS" -> "item2" [label="aaas0"];
>   "AAAS" -> "item5" [label="aaas1"];
>   "AAAS" -> "item7" [label="aaas2"];
>   "AAAS" -> "item9" [label="aaas3"];
>   "AAAS" -> "item12" [label="aaas4"];
> }
> 
> How do I get to see the graph?
> 
> Many thanks,
> 
> Laura
> 
> Laura Thomas
> PhD Student- Sport and Exercise Psychology
> Department of Sport and Exercise
> Penglais Campus
> Aberystywth University
> Aberystwyth
> 
> 01970621947
> lbt1 at aber.ac.uk
> www.aber.ac.uk/en/sport-exercise/
> 
> ______________________________________________
> R-help at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-
> guide.html
> and provide commented, minimal, self-contained, reproducible code.



More information about the R-help mailing list