Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7055441
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T03:44:58+00:00 2026-05-28T03:44:58+00:00

I’m using the mlogit package in R to estimate a mixed logit model with

  • 0

I’m using the mlogit package in R to estimate a mixed logit model with a log-normal parameter. The package runs fine, but is there a way to extact the random coefficients, particularly for non-normally distributed parameters?

Using an example from “Kenneth Train’s exercises using the mlogit package for R”, p 22,

library(mlogit)
data("Electricity", package = "mlogit")
Electr <- mlogit.data(Electricity, id = "id", choice = "choice", 
               varying = 3:26, shape = "wide", sep = "")

Electr$rev.tod <- -1*Electr$tod  # Reverse sign on tod parameter
Elec.mxl <- mlogit(choice ~ pf + cl + loc + wk + rev.tod + seas | 0, data=Electr, 
               rpar = c(cl = "n", loc = "n", wk = "u", rev.tod = "ln", seas = "n"),
               R = 100, halton = NA, print.level = 0, panel = TRUE)
summary(Elec.mxl)

Generates this (truncated) output:

Coefficients :
            Estimate Std. Error t-value  Pr(>|t|)    
pf         -0.866325   0.032452 -26.696 < 2.2e-16 ***
cl         -0.203770   0.013411 -15.194 < 2.2e-16 ***
loc         2.038715   0.079918  25.510 < 2.2e-16 ***
wk          1.481339   0.065181  22.727 < 2.2e-16 ***
rev.tod     2.105324   0.033971  61.973 < 2.2e-16 ***
seas       -8.490331   0.279262 -30.403 < 2.2e-16 ***
sd.cl       0.360140   0.017474  20.610 < 2.2e-16 ***
sd.loc      1.575765   0.089507  17.605 < 2.2e-16 ***
sd.wk       1.600303   0.122982  13.012 < 2.2e-16 ***
sd.rev.tod  0.390088   0.021940  17.780 < 2.2e-16 ***
sd.seas     1.997713   0.106031  18.841 < 2.2e-16 ***

random coefficients
              Min.    1st Qu.     Median       Mean     3rd Qu.     Max.
cl            -Inf -0.4466810 -0.2037701 -0.2037701  0.03914082      Inf
loc           -Inf  0.9758776  2.0387151  2.0387151  3.10155255      Inf
wk      -0.1189636  0.6811879  1.4813394  1.4813394  2.28149087 3.081642
rev.tod  0.0000000  6.3104924  8.2097637  8.8587752 10.68065958      Inf
seas          -Inf -9.8377681 -8.4903311 -8.4903311 -7.14289412      Inf

Is there any way to extract the mean of these random coefficients? This is mainly an issue for the non-normally distributed parameters. As pointed out by Train & Croissant, you can use the following code to calculate the mean coefficient for a log-normally distributed parameter, but I’m wondering if there is a more straightforward (and simpler!) approach.

-exp(coef(Elec.mxl)["rev.tod"]+(0.5*(coef(Elec.mxl)["sd.rev.tod"])**2))
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T03:44:58+00:00Added an answer on May 28, 2026 at 3:44 am

    Actually … it generates no output. You must have also executed summary(Elec.mxl). The other problem besides not telling us the source of the output is that the mean of a sequence that includes -Inf is going to be either -Inf or undefined depending on the pleasures of the authors of the system. If you mean the column named “Mean” then (after looking at the structure of the summary object) this should do the trick:

         summary(Elec.mxl)$summary.rpar[ , "Mean"]
    #        cl        loc         wk    rev.tod       seas 
    #-0.2551692  1.9159597  1.6331273  8.9872786 -8.4093959 
    

    You did say you wanted only the random coefficients, right? (Aren’t you a bit worried about a logit model that is producing coeffocients on the order of 8? at least in regular logit models it generally indicates a data situation that is creating pathological results.)

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm new to using the Perl treebuilder module for HTML parsing and can't figure
That's pretty much it. I'm using Nokogiri to scrape a web page what has
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I want to count how many characters a certain string has in PHP, but
I'm using v2.0 of ClassTextile.php, with the following call: $testimonial_text = $textile->TextileRestricted($_POST['testimonial']); ... and
Seemingly simple, but I cannot find anything relevant on the web. What is the
I have a French site that I want to parse, but am running into
We're building an app, our first using Rails 3, and we're having to build
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
We are using XSLT to translate a RIXML file to XML. Our RIXML contains

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.