mapindex {PSSIM}R Documentation

Index in one vector mapped to treatment and observation index

Description

Function mapindex() maps the 1-d index r=1,...,N to 2-d index i=1, ...a, j=1, ..., ni. Generally the covariate values from all treatments are stored together in one vector and r=1,...,N enumerates the values. For any integer between 1 and N, mapindex tells which treatment the rth value belongs to, and which observation in the identified treatment.

Usage

mapindex(r, n)

Arguments

r

an integer between 1 and sum(n).

n

a vector of the sample sizes.

Value

the 2-d index, where the first gives which treatment the value belongs to and the second gives which observation in that treatment.

Examples

r=5; n=c(7, 8); mapindex(r, n)
r=7; n=c(7, 8); mapindex(r, n)
r=9; n=c(7, 8); mapindex(r, n)

[Package PSSIM version 0.1.0 Index]