A word, mathematically expressed, is a sequence of symbols in a finite set, called an alphabet. Parikh matrix is an ingenious tool providing information on certain subsequences of a word, referred to as subwords. On the other hand, based on subwords of a word, the notion of precedence matrix or p-matrix of a word has been introduced in studying a property, known as fair words. In this paper we consider p-matrix for words especially over binary and ternary alphabets and obtain several algebraic properties of the p-matrix.