# stairs1: Calculation of the stairs1 value for rooted binary trees In treebalance: Computation of Tree (Im)Balance Indices

## Description

This function calculates the stairs1 value st1(T) for a given rooted binary tree T. It is a modified version of the Rogers J index and is defined as the fraction of inner vertices whose balance value is unequal to zero, more precisely

st1(T)=1/(n-1)*∑ (1-I(n_ua=n_ub)) over all u in V_in(T)

in which V_in(T) denotes the set of all inner vertices of T, and in which n_ua and n_ub denote the number of leaves in the two pending subtrees that are rooted at the direct descendants of u. The stairs1 value is an imbalance index.

Special cases: For n=1, the function returns st1(T)=0 and a warning.

## Usage

 `1` ```stairs1(tree) ```

## Arguments

 `tree` A rooted binary tree in phylo format.

## Value

`stairs1` returns the stairs1 value of the given tree.

Sophie Kersting

## References

M. M. Norström, M. C. Prosperi, R. R. Gray, A. C. Karlsson, and M. Salemi. PhyloTempo: A Set of R Scripts for Assessing and Visualizing Temporal Clustering in Genealogies Inferred from Serially Sampled Viral Sequences. Evolutionary Bioinformatics, 8:EBO.S9738, 2012. ISSN 1176-9343, 1176-9343. doi:10.4137/EBO.S9738.

## Examples

 ```1 2``` ```tree <- ape::read.tree(text="((((,),),(,)),(((,),),(,)));") stairs1(tree) ```

treebalance documentation built on Oct. 17, 2021, 5:06 p.m.
{"ft_lang_label":"__label__en","ft_lang_prob":0.71658427,"math_prob":0.9312254,"size":1226,"snap":"2021-43-2021-49","text_gpt3_token_len":347,"char_repetition_ratio":0.09738134,"word_repetition_ratio":0.0,"special_character_ratio":0.26590538,"punctuation_ratio":0.15503876,"nsfw_num_words":0,"has_unicode_error":false,"math_prob_llama3":0.9663302,"pos_list":[0],"im_url_duplicate_count":[null],"WARC_HEADER":"{\"WARC-Type\":\"response\",\"WARC-Date\":\"2021-12-01T02:41:53Z\",\"WARC-Record-ID\":\"<urn:uuid:0873eebc-8c17-4d9c-b929-487cc1f84f89>\",\"Content-Length\":\"38723\",\"Content-Type\":\"application/http; msgtype=response\",\"WARC-Warcinfo-ID\":\"<urn:uuid:6072892c-637e-4c7d-906d-e36237f610e7>\",\"WARC-Concurrent-To\":\"<urn:uuid:bd32a681-2e0a-4bc2-9d1a-8c5d190e0353>\",\"WARC-IP-Address\":\"51.81.83.12\",\"WARC-Target-URI\":\"https://rdrr.io/cran/treebalance/man/stairs1.html\",\"WARC-Payload-Digest\":\"sha1:ZLBPQ3NA7AJ6W2COBVMFACMRR4OWBJMP\",\"WARC-Block-Digest\":\"sha1:LI2WFIT5LCZRORDPZLFCYQZHDIRYPGKS\",\"WARC-Identified-Payload-Type\":\"text/html\",\"warc_filename\":\"/cc_download/warc_2021/CC-MAIN-2021-49/CC-MAIN-2021-49_segments_1637964359082.78_warc_CC-MAIN-20211201022332-20211201052332-00110.warc.gz\"}"}