Monday, December 21, 2015

ggplot2 2.0.0

ggplot2 2.0.0


I have used the ggplot2 package for a while and really like this package. It's happy to see that Hadley Wickham has officially updated the ggplot2 to version 2.0.0. On the RStudio Blog, Hadley highlights several important changes:
  • ggplot2 now has an official extension mechanism.
  • There are a handful of new geoms, and updates to existing geoms.
  • The default appearance has been thoroughly tweaked so most plots should look better.
  • Facets have a much richer set of labelling options.
  • The documentation has been overhauled to be more helpful, and require less integration across multiple pages.
  • A number of older and less used features have been deprecated.


You can find the document/manua on the project website. Many times, I go to the dev website to find the latest document/vignettes (extension, aesthetic specifications, themes).

The R Graphics Cookbook by Winston Chang is a must-have book to learn and become an expert of ggplot2 user. You can find the codes here from the Cookbook-R, and the Google book here.

Tuesday, December 15, 2015

general linear models vs. generalized linear models

General linear models vs. generalized linear models


 



Typical estimation method



Special cases



Function in R



Function in Matlab

mvregress()

glmfit()

Procedure in SAS



Command in Stata



Function in Mathematica

LinearModelFit

GeneralizedLinearModelFit

Command in EViews

ls
  • Generalized linear models have the flexiblility for response variables that have other than a normal distribution. If a generalized linear model uses an identity link function and a normal family distribution, then this model is equivalent to a general linear model.
  • Generalized linear mixed models have the flexibility to model random effects and correlated errors for nonmormal data.

non-probability sample

Non-Probability Sample


Definition
Reflection
Video