0

I am trying to replicate the Stata code below from this package here but it gives an invalid syntax error. I am using Stata 12 on Windows 7. Any ideas on how to solve this

clear
program drop _all
mata mata clear

sysuse auto
generate heavy=weight>3000
generate expensive=price>4000

label variable foreign "foreign"

VennDiagram foreign heavy expensive, title("Car market structure") 
Keniajin
  • 1,649
  • 2
  • 20
  • 43
  • Have you defined program called `VennDiagram ` or have `VennDiagram .ado` stored in [appropriate location](http://www.stata.com/support/faqs/programming/search-path-for-ado-files/)? – radek Jul 26 '16 at 09:34
  • I followed the instructions here http://radyakin.org/stata/venndiagram/venndiagram.htm ... I am checking on here `C:\Program Files (x86)\Stata12\ado\updates` but cant find the `.ado` – Keniajin Jul 26 '16 at 09:48
  • 1
    I tried following the instructions at the location you give. The first instruction is to run `findit twoway_parea` and then click on the install link. When I run the command, it does not return any results to install. Note that the location you give ends with the author's name and email address for support. Note also that running `search venn` in Stata finds an alternative program for producing Venn diagrams. From the `search venn` results, follow the link for package gr34_3. –  Jul 26 '16 at 11:54
  • 1
    @WilliamLisowski thanks i tried the `twoway parea high date, pattern(pattern8) || parea low date, pattern(pattern6) scale(0.5)`after running the installation command for `twoway parea` and it worked. So from my side it has installed – Keniajin Jul 26 '16 at 16:10
  • As mentioned in the comment to Sergly Radyakin's answer below, I apparently did something wrong when I ran `findit twoway_parea` because that now produces the intended result. –  Jul 28 '16 at 22:56

2 Answers2

2

OK, first off, based on the comments above, I discovered that despite the instruction to

findit twoway_parea

the required command is

findit twoway parea

so ultimately I was able to successfully install the two pieces I needed for VennDiagram.

There are three syntax errors in venndiagram.ado. At line 96 we see

# delimit ;

At lines 100, 148, and 245 we see

          version 9.2

Each of those needs a semicolon following it.

          version 9.2;

With those three changes, the example runs without producing a syntax error.

  • thanks for this .. how can i access the `venndiagram.ado` – Keniajin Jul 26 '16 at 20:10
  • As mentioned in the comment to Sergly Radyakin's answer below, `findit twoway_parea` does produce the intended result; my statement to the contrary was wrong. –  Jul 28 '16 at 22:57
1

1) William Lisowski is correct: a semicolumn was missing in the program. This has been fixed now.

2) On the installation: VennDiagram requires a Stata package twoway_parea. The instruction provided on my website is one of the million of ways to SEARCH for it with the standard Stata's findit command. The results you are getting may be dependent on your Stata version, environment, internet connectivity, etc. On my machine the findit twoway_parea , findit twoway parea , and findit parea all yield exactly the same intended result. If there is any problem with the Stata findit command, kindly contact the Stata tech support.

Sergiy Radyakin

Keniajin
  • 1,649
  • 2
  • 20
  • 43
  • Indeed, Sergly Radyakin is correct: when I tried today, `findit twoway_parea` returns the intended result. I must have done something incorrectly when I made the attempt reported on in my earlier comment and answer. –  Jul 28 '16 at 22:54