POSAC: Partial Order Scalogram Analysis with Base Coordinates.

Description Usage Arguments Value Examples

Description

This functions takes a matrix of patterns and the frequencies of the patterns and performs POSAC analysis.

Usage

1
POSAC(patmat, freqs, greedy = FALSE)

Arguments

patmat

A matrix of patterns of values across. Each row of the matrix should represents a distinct pattern with no duplicates. The columns are the variables defining the patterns.

freqs

A vector of frequencies of each pattern. This should have the same length as nrow(patmat).

greedy

Logical value denoting whether optimisation method should finish with a greedy search through all possible movements of each point in order to improve the number of pairs of patterns that are correctly positioned. Setting this to true will make the process somewhat slower. The default value is FALSE.

Value

The function returns a list with the following elements:

Criteria

The output from the function realcriteria for the final solution.

X

The ranking of each pattern on the first dimension of the returned POSAC solution.

Y

The ranking of each pattern on the second dimension of the returned POSAC solution.

Patterns

A character vector of concatenated patterns.

patmat

The pattern matrix used in analysis to begin with.

freqs

The frequency with which in pattern occurs.

tidyframe

A single data frame containing the structuples(patterns), frequencies, X, Y, rescaled X and Y to be between a 0 and 100, J (=rescaled X+rescaled Y)and L(=100+rescaled X-rescaled Y).

mumatrix

Matrix of monotonicity coefficients between each of the original variables and the resulting rescaled X, Y, J and L.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#POSAC analysis of some simple patterns
posac1=POSAC(SimplePOSACdata[,1:4],SimplePOSACdata[,5])
posac1
plot(posac1$X,posac1$Y,type='n',xlab="Facet analysis X",ylab="Facet analysis Y")
text(posac1$X,posac1$Y,posac1$Patterns)

#POSAC analysis of some CRAS patterns
posac2=POSAC(CRASdata[,1:5],CRASdata[,6])
posac2
plot(posac2$X,posac2$Y,type='n',xlab="Facet analysis X",ylab="Facet analysis Y")
text(posac2$X,posac2$Y,posac2$Patterns)
posac2$tidyframe

#An enhanced plot with colour used to indicate the frequency of patterns
library(ggplot2)
g1=ggplot(data=data.frame(X=posac2$X
				,Y=posac2$Y
				,pat=posac2$Patterns
				,Freq=posac2$freqs),
	aes(x=X,y=Y,label=pat,col=Freq))
g1+geom_text()+theme_minimal()+labs(x="Facet analysis X",y="Facet analysis Y")

#make an item diagram using ggplot2 (can also be done using the itemdiagram function)
g2=ggplot(data=data.frame(X=posac2$X,Y=posac2$Y),
          aes(x=X,y=Y,label=posac2$patmat$complex,col=as.factor(posac2$patmat$complex)))
g2+geom_text()+geom_point()+theme_minimal()+labs(x="Facet analysis X",y="Facet analysis Y")+guides(col="none")

CambridgeAssessmentResearch/POSAC documentation built on May 28, 2019, 12:16 p.m.