RE: st: problem with perturb

 From KONSTANTARAS KONSTANTINOS To statalist@hsphsun2.harvard.edu Subject RE: st: problem with perturb Date Sat, 27 Dec 2008 19:43:45 +0200 (EET)

```Sorry, but copy paste did not work previously. Please find below the output of perturb before it stops:

The last few lines of output are:

The reclassification probabilities will be adjusted to let
the expected frequencies of the reclassified variable be equal to those of _Iy
```
```ear_2002
```
```
The expected table will be quasi-independent
ln(q)=:         2.944

----------------------------------------
original  |
variable  |
```
_Iyear_20 | reclassifed variable 02 | 1 2 Total
```----------+-----------------------------
1 | 1021.559    19.441  1041.000
2 |   19.441   133.559   153.000
```
| Total | 1041.000 153.000 1194.000
```----------------------------------------

Final reclassification probabilities:

-------------------------------
original  |
variable  |
_Iyear_20 |reclassifed variable
02        |     1      2  Total
----------+--------------------
1 | 0.981  0.019  1.000
2 | 0.127  0.873  1.000
-------------------------------
invalid syntax
r(198);

```
KONSTANTARAS KONSTANTINOS <dinokon@otenet.gr> wrote:
```Dear Statalisters,

Seasons Greetings!

I run into a problem in my attempting to run perturb for a multinomial logit application; apparently the problem must have something to do with the way I have defined the covariate to be perturbed, as from what I have found setting trace on the application produces an Invalid Syntax Error as it tries to read the number of pfactors defined as perturbation variables, namely n_par in the ado file; the traced problem is as follows:

....output ommitted..
- forval k=1/`niter' {
= forval k=1/100 {
- forval k=1/`niter' {
- forval i=1/`n_pvar' {
= forval i=1/ {
invalid syntax
local pv: word `i' of `pvars'
local pr: word `i' of `prange'
`how' replace `pv`i'' = `pv'+`perturb'*`pr'
}

i.e. it does not recognize the number of factors I have input (1), although it has previously produced the initial classification probabilities, adjusted expected table and final reclassification probabilities having recognized that I am using it as factor –see output below.

The command I am issuing is as follows:

perturb2: mlogit depn defone ldef3 sizmc remc recumz  _Iyear_1998 _Iyear_1999 _Iyear_2000 _Iyear_2001 _Iyear_2002 _Iyear_2003 if year>1997?

Any help would be greatly appreciated.

```
Dino Konstantaras
```*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/

```
```
*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/
```