Creating Graphics with GranovaGG

To install the latest copy of granovaGG from CRAN

install.packages("granovaGG", dependencies = TRUE)

Next, load the package

library(granovaGG)

Now, you can try some sample graphics. The code below creates a sample granovagg.1w graphic. Note the “fanning” effect in the above graphic, where the variance of groups grows as we move left-to-right. The fanning suggests a need to transform our data into a form with more uniform variance across groups.

data(poison)
p <- granovagg.1w(
       data  = poison$SurvTime, 
       group = poison$Group, 
       ylab  = "Survival Time"
     )
print(p)

The printed output of the above call to granovagg.1w() is shown below, along with the plot graphic itself.

## By-group summary statistics for your input data (ordered by group means)
##    group group.mean trimmed.mean contrast variance standard.deviation
## 3      3       0.21         0.21    -0.27     0.00               0.02
## 9      9       0.24         0.24    -0.24     0.00               0.01
## 2      2       0.32         0.32    -0.16     0.01               0.08
## 12    12       0.32         0.32    -0.15     0.00               0.03
## 6      6       0.34         0.34    -0.14     0.00               0.05
## 8      8       0.38         0.38    -0.10     0.00               0.06
## 1      1       0.41         0.41    -0.07     0.00               0.07
## 7      7       0.57         0.57     0.09     0.02               0.16
## 10    10       0.61         0.61     0.13     0.01               0.11
## 11    11       0.67         0.67     0.19     0.07               0.27
## 5      5       0.82         0.82     0.34     0.11               0.34
## 4      4       0.88         0.88     0.40     0.03               0.16
##    group.size
## 3           4
## 9           4
## 2           4
## 12          4
## 6           4
## 8           4
## 1           4
## 7           4
## 10          4
## 11          4
## 5           4
## 4           4
## The following groups are likely to be overplotted
##    group group.mean contrast
## 2      2       0.32    -0.16
## 12    12       0.32    -0.15
## 6      6       0.34    -0.14
## Below is a linear model summary of your input data
## 
## Call:
## lm(formula = score ~ group, data = owp$data)
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -0.3250 -0.0488  0.0050  0.0431  0.4250 
## 
## Coefficients:
##             Estimate Std. Error t value Pr(>|t|)    
## (Intercept)   0.4125     0.0746    5.53  2.9e-06 ***
## group2       -0.0925     0.1055   -0.88  0.38623    
## group3       -0.2025     0.1055   -1.92  0.06278 .  
## group4        0.4675     0.1055    4.43  8.4e-05 ***
## group5        0.4025     0.1055    3.82  0.00051 ***
## group6       -0.0775     0.1055   -0.73  0.46716    
## group7        0.1550     0.1055    1.47  0.15030    
## group8       -0.0375     0.1055   -0.36  0.72422    
## group9       -0.1775     0.1055   -1.68  0.10100    
## group10       0.1975     0.1055    1.87  0.06923 .  
## group11       0.2550     0.1055    2.42  0.02079 *  
## group12      -0.0875     0.1055   -0.83  0.41216    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 
## 
## Residual standard error: 0.149 on 36 degrees of freedom
## Multiple R-squared: 0.734,   Adjusted R-squared: 0.652 
## F-statistic: 9.01 on 11 and 36 DF,  p-value: 1.99e-07 
## 

plot of chunk printedPlot