profileline: Profile line (of multiple groups) in multiple items

profilelineR Documentation

Profile line (of multiple groups) in multiple items

Description

draws a profile line of means or medians in multiple items and groups

Usage

profileline(
  matrix,
  group = 1,
  type = "Median",
  groupnames = levels(factor(group)),
  main = "",
  col = 2:(length(unique(group)) + 1),
  pch = 1:length(levels(factor(group))),
  lty = 1:length(levels(factor(group))),
  lwd = 2,
  grid = TRUE,
  space_left = max(nchar(names(matrix)))/3 + 2.5,
  xlab = "",
  labels = "",
  extreme = FALSE,
  cex.axis.x = 1,
  cex.axis.y = 1,
  axis.top = TRUE,
  axis.bottom = TRUE,
  low_label = "",
  high_label = "",
  padj = 3,
  bottom.adj = 0,
  legend = TRUE,
  N_legend = TRUE,
  cex.legend = 1,
  title = TRUE
)

Arguments

matrix

a data.frame or matrix containing the likert variables to draw

group

grouping variable for profile lines (optional)

type

type of line: one out of "Median", "Mean", "1. Quartile", "3. Quartile"

groupnames

names of groups

main

title

col

color of group lines

pch

point character

lty

point character

lwd

line width of profile line

grid

draw grid

space_left

space to y axis of first bar

xlab

x axis label

labels

labels displayed on x axes (must be of length

extreme

only draw poles of labels (senseful for likert items)

cex.axis.x

cex of x axis

cex.axis.y

cex of y axis

axis.top

draw top axis

axis.bottom

draw bottom axis

low_label

lowest level

high_label

highes level

padj

vertical adjust of low/high levels

bottom.adj

mar bottom adjust

legend

draw legend

N_legend

draw legend of N observations per group

cex.legend

character expansation of legend

title

legends title

Examples

matrix<-data.frame(matrix(sample(-3:3,1000,T),ncol=20))
names(matrix)<-paste("Item",1:20); g<-paste("Group",rep(1:3,length=200))
for(i in 1:dim(matrix)[2]){matrix[,i]<-factor(matrix[,i],-3:3,c("fully disagree","2","3","4","5","6","fully agree"))}
profileline(matrix,g,main="",N_legend=T,pch="",type="Mean",ex=T,low="low",high="high",xlab="agreement")

ingmarboeschen/graphing documentation built on Jan. 14, 2025, 7:32 a.m.