# mlogit. Negative value for sd

I fit a mixed logit using mlogit package, but I get negative values for standard deviation. Any idea why I am getting negative values and how this is interpreted?

library(mlogit)
#data
code=c( "obs4694", "obs4681", "obs1362", "obs3372", "obs1001", "obs747",  "obs4738", "obs3861", "obs3044", "obs2651",
"obs2354", "obs1805", "obs3289", "obs2460", "obs1547", "obs2904", "obs534", "obs2818", "obs3681", "obs2516",
"obs2527", "obs2283", "obs2173", "obs3765", "obs444",  "obs4513", "obs1005", "obs1934", "obs3229", "obs2561")
mcollege=c("no",  "no",  "no",  "yes", "yes", "no",  "yes", "no",  "no",  "no",
"no",  "no",  "no",  "no",  "no",  "yes", "no",  "yes", "no",  "yes",
"yes", "no",  "no",  "no",  "no",  "no",  "no",  "no",  "no", "no")
Dist=c(1,1,4,1,4,3,2,4,1,3,3,4,1,3,3,2,1,2,1,1,3,2,4,1,3,3,4,1,3,1)
Data <- data.frame(code, mcollege, Dist)

# model
MNLData <- mlogit.data(Data, id='code', shape='wide', choice='Dist')
Output <- mlogit(Dist~1|mcollege|1, MNLData,rpar=c('2:(intercept)'='n', '3:(intercept)'='n', '4:(intercept)'='n', '2:mcollegeyes'='n', '3:mcollegeyes'='n', '4:mcollegeyes'='n'), R=100, halton=NA, print.level=1)
summary(Output)


When I check the coefficient results in summary the estimated sd for four of the variables are negative:

Coefficients :
Estimate Std. Error t-value Pr(>|t|)
2:(intercept)       -2.6593    56.1853 -0.0473   0.9622
3:(intercept)      -14.4052   389.3052 -0.0370   0.9705
4:(intercept)      -12.3455   323.4815 -0.0382   0.9696
2:mcollegeyes      -21.7190  1322.7599 -0.0164   0.9869
3:mcollegeyes      -32.4405   894.8809 -0.0363   0.9711
4:mcollegeyes      -68.2683  7951.4086 -0.0086   0.9931
sd.2:(intercept)    -1.1784    73.3574 -0.0161   0.9872   #negative
sd.3:(intercept)    52.0240  1373.2141  0.0379   0.9698
sd.4:(intercept)    27.0898   698.0700  0.0388   0.9690
sd.2:mcollegeyes  -275.3367 14154.1320 -0.0195   0.9845   #negative
sd.3:mcollegeyes   -41.2779  1680.3746 -0.0246   0.9804   #negative
sd.4:mcollegeyes   -96.8595  7558.5953 -0.0128   0.9898   #negative

• Where do you see the standard deviation? – Pascal Jun 23 '15 at 0:50
• @Pascal: I updated the post – Milad Jun 23 '15 at 1:42
• At least, stdev(Output) are positive. – Pascal Jun 23 '15 at 2:58
• Interesting. does it mean that I can rely on stdev(Output) and assume that estimated SDs are all positive? – Milad Jun 23 '15 at 3:05
• Thanks for your suggestion. I posted similar question on Cross Validated. – Milad Jun 23 '15 at 3:23

Interpret the values as positive. The negative values are a side-effect of how the MSLE algorithm works (specifically how the normal variates are generated; since the normal distribution symmetric, it doesn't matter if you generate a $N(\mu,\sigma)$-distributed random variable with $\mu + \sigma Z$ or $\mu - \sigma Z$ where $Z$ is a standard normal; furthermore, allowing $\sigma$ to be negative means that the optimization is unconstrained rather than constrained, making it a much easier problem to solve).
For publication/distribution to others, I just manually change the negative values to positive values in the table of estimates. If you do manipulation/graphing of the estimates themselves you'll want to make sure you use abs() or stdev() so you don't get unexpected results. If you look in the source code of stdev.rpar() you'll see that it simply applies abs() to the sigma component of the rpar object.