starmaker: Produce stars from p values for tables.

Description Usage Arguments Value Author(s) Examples

View source: R/starmaker.r

Description

Recodes p values to stars for use in tables.

Usage

1
starmaker(x, p.levels=c(.001, .01, .05, .1), symbols=c("***", "**", "*", "+"))

Arguments

x

A vector of p values to be turned into stars (must be numeric).

p.levels

A vector of the maximum p value for each symbol used (p<p.level).

symbols

A vector of the symbols to be displayed for each p value.

Value

A vector of length equal to that of x of class character.

Author(s)

Josh Pasek, Assistant Professor of Communication Studies at the University of Michigan (www.joshpasek.com).

Examples

1
2
starmaker(seq(0, .15, by=.01))
cbind(p=seq(0, .15, by=.01), star=starmaker(seq(0, .15, by=.01)))

Example output

Loading required package: Hmisc
Loading required package: lattice
Loading required package: survival
Loading required package: Formula
Loading required package: ggplot2

Attaching package: 'Hmisc'

The following objects are masked from 'package:base':

    format.pval, units

Loading required package: gdata
sh: 1: cannot create /dev/null: Permission denied
gdata: Unable to locate valid perl interpreter
gdata: 
gdata: read.xls() will be unable to read Excel XLS and XLSX files
gdata: unless the 'perl=' argument is used to specify the location of a
gdata: valid perl intrpreter.
gdata: 
gdata: (To avoid display of this message in the future, please ensure
gdata: perl is installed and available on the executable search path.)
sh: 1: cannot create /dev/null: Permission denied
gdata: Unable to load perl libaries needed by read.xls()
gdata: to support 'XLX' (Excel 97-2004) files.

gdata: Unable to load perl libaries needed by read.xls()
gdata: to support 'XLSX' (Excel 2007+) files.

gdata: Run the function 'installXLSXsupport()'
gdata: to automatically download and install the perl
gdata: libaries needed to support Excel XLS and XLSX formats.

Attaching package: 'gdata'

The following object is masked from 'package:stats':

    nobs

The following object is masked from 'package:utils':

    object.size

The following object is masked from 'package:base':

    startsWith

Loading required package: mice

Attaching package: 'mice'

The following objects are masked from 'package:base':

    cbind, rbind

 [1] "***" "**"  "*"   "*"   "*"   "*"   "+"   "+"   "+"   "+"   "+"   ""   
[13] ""    ""    ""    ""   
      p      star 
 [1,] "0"    "***"
 [2,] "0.01" "**" 
 [3,] "0.02" "*"  
 [4,] "0.03" "*"  
 [5,] "0.04" "*"  
 [6,] "0.05" "*"  
 [7,] "0.06" "+"  
 [8,] "0.07" "+"  
 [9,] "0.08" "+"  
[10,] "0.09" "+"  
[11,] "0.1"  "+"  
[12,] "0.11" ""   
[13,] "0.12" ""   
[14,] "0.13" ""   
[15,] "0.14" ""   
[16,] "0.15" ""   

weights documentation built on June 11, 2021, 1:06 a.m.

Related to starmaker in weights...