Hi everyone

I'm doing a simulation study following Adkins & Gade (p.26-27) and can't figure out an embarrasingly simple question on Stata syntax. When I run the code below, Stata returns
Code:
‘sim’ invalid name
The syntax is pasted from the document and should be fine. I've tried
Code:
`sim´
to no avail, and I wonder if anyone here might know where the problem lies.

Here is the simulation:
Code:
global nobs = 200
global nmc = 1000
set seed 10101
set obs $nobs

scalar slope = 1 /* regression slope */
scalar sigma = 10 /* measurement error in y */
scalar sige = .1 /* amount of measurement error in e */
scalar gam = 1 /* instrument strength */
scalar rho = .5 /* correlation between errors */
scalar alpha=.05 /* test size */

gen z = 5*runiform()
gen y = .
gen x = .
gen u = .

program regIV, rclass
tempname sim
    postfile ‘sim’ b biv se se_iv p_ls p_iv using results, replace
    quietly {

    forvalues i = 1/$nmc {
        replace u = rnormal()
        replace x = gam*z+rho*u+rnormal(0,sige)
        replace y = slope*x + u
        reg y x
            scalar b = _b[x]
            scalar se = _se[x]
            scalar lb = b - se*invttail(e(df_r),alpha/2)
            scalar ub = b + se*invttail(e(df_r),alpha/2)
            scalar pv = slope<ub & slope>lb

        ivreg y (x=z)
            scalar biv = _b[x]
            scalar seiv = _se[x]
            scalar lb = biv - seiv*invttail(e(df_r),alpha/2)
            scalar ub = biv + seiv*invttail(e(df_r),alpha/2)
            scalar pvr = slope<ub & slope>lb

        post ‘sim’ (b) (biv) (se) (seiv) (pv) (pvr)
        }
    }
    postclose ‘sim’
end

regIV
use results, clear
summarize