ri()#
- liesel_ptm.ri(x, xname=None)[source]#
Create a random-intercept basis from grouping labels.
The returned
Basismaps arbitrary group labels (strings or integers) to contiguous integer indices suitable for indexing group coefficients. The produced basis yields, for each observation, the integer group index which can be used byterm_rito select the corresponding group effect.- Parameters:
x (
Union[Array,ndarray,bool,number,bool,int,float,complex,Series,Var]) – Grouping labels for each observation. Ifxis not anliesel.model.Var, a named observation variable will be created usingxname.xname (
str|None) – Name for the created observation variable whenxis not already anliesel.model.Var. (default:None)
- Return type:
Basis- Returns:
A
Basiswhose evaluation yields integer group indices foreach observation.