Publications by Daniel
Changing Axis Values in R Plot
A colleague asked me for how one can change axis attributes in a basic plot. Plotting anything in R is really, really easy. It is enough typing plot(x, y). In general, plot functions are nicely pre-cooked, so hardly one needs to change anything. But if changes in the default attributes are needed, it is possible to achieve by including extra info...
1970 sym 2 img
Plotting lm and glm models with ggplot #rstats
Update I followed the advice from Tim’s comment and changed the scaling in the sjPlotOdds-function to logarithmic scaling. The screenshots below showing the plotted glm’s have been updated. Summary In this posting I will show how to plot results from linear and logistic regression models (lm and glm) with ggplot. As in my previous postings on...
4223 sym R (756 sym/6 pcs) 16 img
Getting the data for the sjPlotting-functions into shape #rstats
I sometimes get questions on how to reproduce the samples that are posted in this blog. Currently, I’m referring to these posts: Plotting lm and glm models with ggplot Easily plotting grouped bars with ggplot Simplify frequency plots with ggplot in R When I wrote these functions, I had in mind how to visualize the date that we (in our researc...
3329 sym R (2389 sym/3 pcs) 4 img
Examples for sjPlotting functions, including correlations and proportional tables with ggplot #rstats
Sometimes people ask me how the examples of my plotting functions I show here can be reproduced without having a SPSS data set (or at least, without having the data set I use because it’s not public yet). So I started to write some examples that run “out of the box” and which I want to present you here. Furthermore, two new plotting functio...
6692 sym R (1702 sym/19 pcs) 32 img
Parallel Processing: When does it worth?
Most computers nowadays have few cores that incredibly help us with our daily computing duties. However, when statistical softwares do use parallelization for analyzing data faster? R, my preferred analytical package, does not take too much advantage of multicore processing by default. In fact, R has been inherently a “single-processor” pac...
4878 sym 4 img
Advanced Graphics I
Polygon is a such handy function in R for drawing beautiful charts where we can select regions (polygons) of the surface. It’s quite useful for indicating confidence regions of parameters, predictions for time-series, or areas under distributions: Related To leave a comment for the author, please follow the link and comment on their blog: ...
670 sym 2 img
Got Bootstrap?
This week I read the book by Michael Chernick and Robert LaBudde, An Introduction to Bootstrap Methods with Applications to R. It’s an interesting oeuvre for useRs of all stripes. I strongly recommend check it out. The book brings lots of examples of bootstrapping applications, such as standard errors, confidence intervals, hypothesis testing...
6415 sym 6 img
Plotting principal component analysis with ggplot #rstats
This script was almost written on parallel to the sjPlotCorr script because it uses a very similar ggplot-base. However, there’s also a very nice posting over at Martin’s Bio Blog which show alternative approaches on plotting PCAs. Anyway, if you download the sjPlotPCA.R script, you can easily plot a PCA with varimax rotation like this: liker...
1834 sym R (756 sym/2 pcs) 10 img
Plotting Likert-Scales (net stacked distributions) with ggplot #rstats
First of all, credits for this script must go to Ethan Brown, whose ideas for creating Likert scales like plots with ggplot built the core of my sjPlotLikert.R-script. All I did was some visual tweaking like having positive percentage values on both sides of the x-axis, adding value labels and so on… You can pass a lot of different parameters t...
1978 sym R (2444 sym/4 pcs) 14 img
Print glm-output to HTML table #rstats
We often use logistic regression models in our analyses and we also often need to publish the results in table format. And, we always use MS Word since this is our standard office in our department. So I thought about an easy way of how to transfer the results of fitted generalized linear models from R to Word. An appropriate way – for me – i...
1602 sym R (1241 sym/5 pcs) 4 img