Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added support for polr and summary.polr for MASS #217

Merged
merged 1 commit into from Aug 10, 2015

Conversation

RomanTsegelskyi
Copy link
Contributor

Support for polr/summary.polr from MASS. Here are small examples:

> house.plr <- polr(Sat ~ Infl + Type + Cont, weights = Freq, data = housing)
> pander(house.plr)

Call:
polr(formula = Sat ~ Infl + Type + Cont, data = housing, weights = Freq)


-----------------------------------------------------------------------------
 InflMedium   InflHigh   TypeApartment   TypeAtrium   TypeTerrace   ContHigh 
------------ ---------- --------------- ------------ ------------- ----------
   0.5664      1.289        -0.5724       -0.3662       -1.091       0.3603  
-----------------------------------------------------------------------------

Table: Coefficients


--------------------------
 Low|Medium   Medium|High 
------------ -------------
  -0.4961       0.6907    
--------------------------

Table: Intercepts


Residual Deviance: 3479.149 
AIC: 3495.149 
> pander(summary(house.plr))

Re-fitting to get Hessian


Call:
polr(formula = Sat ~ Infl + Type + Cont, data = housing, weights = Freq)


--------------------------------------------------
      &nbsp;         Value   Std. Error   t value 
------------------- ------- ------------ ---------
  **InflMedium**    0.5664    0.10465      5.412  

   **InflHigh**     1.2888    0.12716     10.136  

 **TypeApartment**  -0.5724   0.11924     -4.800  

  **TypeAtrium**    -0.3662   0.15517     -2.360  

  **TypeTerrace**   -1.0910   0.15149     -7.202  

   **ContHigh**     0.3603    0.09554      3.771  
--------------------------------------------------

Table: Coeficients


------------------------------------------------
     &nbsp;        Value   Std. Error   t value 
----------------- ------- ------------ ---------
 **Low|Medium**   -0.4961    0.1248     -3.974  

 **Medium|High**  0.6907     0.1255      5.505  
------------------------------------------------

Table: Intercepts


Residual Deviance: 3479.149 
AIC: 3495.149 
> pander(summary(house.plr, correlation = TRUE))

Re-fitting to get Hessian


Call:
polr(formula = Sat ~ Infl + Type + Cont, data = housing, weights = Freq)


--------------------------------------------------
      &nbsp;         Value   Std. Error   t value 
------------------- ------- ------------ ---------
  **InflMedium**    0.5664    0.10465      5.412  

   **InflHigh**     1.2888    0.12716     10.136  

 **TypeApartment**  -0.5724   0.11924     -4.800  

  **TypeAtrium**    -0.3662   0.15517     -2.360  

  **TypeTerrace**   -1.0910   0.15149     -7.202  

   **ContHigh**     0.3603    0.09554      3.771  
--------------------------------------------------

Table: Coeficients


------------------------------------------------
     &nbsp;        Value   Std. Error   t value 
----------------- ------- ------------ ---------
 **Low|Medium**   -0.4961    0.1248     -3.974  

 **Medium|High**  0.6907     0.1255      5.505  
------------------------------------------------

Table: Intercepts


Residual Deviance: 3479.149 
AIC: 3495.149 

------------------------------------------------------------------------
      &nbsp;         InflMedium   InflHigh   TypeApartment   TypeAtrium 
------------------- ------------ ---------- --------------- ------------
   **InflHigh**        0.4388                                           

 **TypeApartment**   -0.009507    -0.07377                              

  **TypeAtrium**      0.02199     -0.02934       0.52                   

  **TypeTerrace**     0.007534    -0.01464       0.536         0.4166   

   **ContHigh**       0.05234      0.121        -0.1194       -0.1346   

  **Low|Medium**       0.442       0.3482       0.5828         0.4433   

  **Medium|High**      0.4732      0.4062       0.5514         0.4275   
------------------------------------------------------------------------

Table: Correlation of Coefficients (continued below)


---------------------------------------------------------
      &nbsp;         TypeTerrace   ContHigh   Low|Medium 
------------------- ------------- ---------- ------------
   **InflHigh**                                          

 **TypeApartment**                                       

  **TypeAtrium**                                         

  **TypeTerrace**                                        

   **ContHigh**        -0.1441                           

  **Low|Medium**       0.4685       0.3721               

  **Medium|High**      0.4232       0.3924      0.9172   
---------------------------------------------------------

@codecov-io
Copy link

Current coverage is 76.73%

Merging #217 into master will increase coverage by +0.17% as of 1af0dc4

Powered by Codecov. Updated on successful CI builds.

@daroczig
Copy link
Member

daroczig commented Aug 8, 2015

Is it intentional that we do not add an extra line break between:

Residual Deviance: 3479.149 
AIC: 3495.149 

This will be rendered on the same line after pandoc conversion AFAIK.

RomanTsegelskyi added a commit that referenced this pull request Aug 10, 2015
Added support for polr and summary.polr for MASS
@RomanTsegelskyi RomanTsegelskyi merged commit 303ce99 into Rapporter:master Aug 10, 2015
@RomanTsegelskyi
Copy link
Contributor Author

Fixed the comment and merged

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants