[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"doc-seo-694753-105":3,"detail-sidebar-cat-0-en-105":80,"doc-detail-694753-en":130,"doc-similar-694753":161},{"code":4,"msg":5,"data":6},0,"ok",{"site_id":7,"language":8,"slug":9,"title":10,"keywords":11,"description":12,"schema_data":13,"social_meta":73,"head_meta":75,"extra_data":77,"updated_unix":79},105,"en","stem-stem-and-leaf-display-syntax-options-and-examples","stem - Stem-and-leaf display - Syntax Options and Examples","","stem displays stem-and-leaf plots, providing a compact way to list and reconstruct observations from batch data. The document defines the plot’s structure, where digits to the left form stems and digits on the right form leaves, and explains how all stems sharing the same starting digit and their leaves represent the underlying data values. It details the syntax stem varname with if/in qualifiers and options such as prune, round, truncate, digits, lines, and width, including how rounding and pruning affect the display.",{"@graph":14,"@context":72},[15,34,55],{"@type":16,"itemListElement":17},"BreadcrumbList",[18,23,27,31],{"item":19,"name":20,"@type":21,"position":22},"https://docshare.wps.com","Home","ListItem",1,{"item":24,"name":25,"@type":21,"position":26},"https://docshare.wps.com/document/","Document",2,{"item":28,"name":29,"@type":21,"position":30},"https://docshare.wps.com/document/technology/","Technology",3,{"item":32,"name":10,"@type":21,"position":33},"https://docshare.wps.com/document/stem-stem-and-leaf-display-syntax-options-and-examples/694753/",4,{"url":32,"name":10,"@type":35,"image":36,"author":41,"headline":10,"publisher":44,"fileFormat":47,"inLanguage":8,"description":12,"dateModified":48,"datePublished":49,"encodingFormat":47,"isAccessibleForFree":50,"interactionStatistic":51},"DigitalDocument",{"url":37,"@type":38,"width":39,"height":40},"https://docshare.wps.com/thumbnails/stem-stem-and-leaf-display-syntax-options-and-examples/694753.png","ImageObject",300,407,{"name":42,"@type":43},"Bintang","Person",{"url":19,"name":45,"@type":46},"DocShare","Organization","application/pdf","2026-11-24","2026-11-10",true,{"@type":52,"interactionType":53,"userInteractionCount":30},"InteractionCounter",{"@type":54},"ViewAction",{"@type":56,"mainEntity":57},"FAQPage",[58,64,68],{"name":59,"@type":60,"acceptedAnswer":61},"What are stem and leaves in a stem-and-leaf plot?","Question",{"text":62,"@type":63},"The expression on the left of the vertical bar is the stem, and the digits on the right are the leaves. Stems with the same starting digit, together with their leaves, reconstruct the underlying observations.","Answer",{"name":65,"@type":60,"acceptedAnswer":66},"How do prune, round(), and truncate() affect the plot?",{"text":67,"@type":63},"prune prevents printing stems that have no leaves. round(#) rounds data to the specified units before displaying the plot, while truncate(#) truncates data to those units for display.",{"name":69,"@type":60,"acceptedAnswer":70},"How do digits(), lines(), and width() control the layout?",{"text":71,"@type":63},"digits(#) sets the number of digits per leaf. lines(#) sets the number of stems per every data interval of 10^digits and must divide 10^digits; width(#) sets the stem width, with lines() equivalent to 10^digits / width. Only one of lines() or width() may be specified.","https://schema.org",{"og:url":32,"og:type":74,"og:title":10,"og:site_name":45,"og:description":12},"article",{"robots":76,"canonical":32},"index,follow",{"doc_id":78,"site_id":7},694753,1794347634,{"code":4,"msg":81,"data":82},"success",[83,87,91,95,100,104,109,114,119,122,126],{"id":22,"doc_module":4,"doc_module_name":25,"category_name":84,"show_sort_weight":85,"slug":86},"Story & Novel",90,"story-novel",{"id":26,"doc_module":4,"doc_module_name":25,"category_name":88,"show_sort_weight":89,"slug":90},"Literature",80,"literature",{"id":33,"doc_module":4,"doc_module_name":25,"category_name":92,"show_sort_weight":93,"slug":94},"Exam",70,"exam",{"id":96,"doc_module":4,"doc_module_name":25,"category_name":97,"show_sort_weight":98,"slug":99},5,"Comic",60,"comic",{"id":101,"doc_module":4,"doc_module_name":25,"category_name":29,"show_sort_weight":102,"slug":103},6,50,"technology",{"id":105,"doc_module":4,"doc_module_name":25,"category_name":106,"show_sort_weight":107,"slug":108},7,"Healthcare",40,"healthcare",{"id":110,"doc_module":4,"doc_module_name":25,"category_name":111,"show_sort_weight":112,"slug":113},8,"Research & Report",30,"research-report",{"id":115,"doc_module":4,"doc_module_name":25,"category_name":116,"show_sort_weight":117,"slug":118},9,"Religion & Spirituality",20,"religion-spirituality",{"id":117,"doc_module":4,"doc_module_name":25,"category_name":120,"show_sort_weight":117,"slug":121},"World Cup","world-cup",{"id":123,"doc_module":4,"doc_module_name":25,"category_name":124,"show_sort_weight":123,"slug":125},10,"Lifestyle","lifestyle",{"id":127,"doc_module":4,"doc_module_name":25,"category_name":128,"show_sort_weight":96,"slug":129},19,"General","general",{"code":4,"msg":81,"data":131},{"doc_id":78,"user_id":132,"nickname":42,"user_avatar":133,"doc_module":4,"category_id":101,"category_name":29,"doc_title":10,"doc_description":12,"doc_content":134,"file_id":135,"file_url":136,"file_type":137,"file_size":138,"view_count":30,"is_deleted":4,"is_public":22,"is_downloadable":22,"audit_status":22,"page_count":96,"language":139,"language_code":8,"site_id":7,"html_lang":8,"table_of_contents":140,"faqs":141,"seo_title":142,"seo_description":12,"update_tm":79,"read_time":143,"preview_page_count":33,"preview_urls":144},962085564381,"https://ap-avatar.wpscdn.com/davatar_6f874abed73319feea01a86fa6f0fab8","stem—Stem-and-leaf displays  \nDescription Options Also see  \nQuick start  \nRemarks and examples  \nMenu  \nStored results  \nSyntax References  \nDescription  \nstem displays stem-and-leaf plots.  \nQuick start  \nStem-and-leaf plot for v1  \nstem v1  \nSame as above, with 2 lines per interval of 10  \nstem v1, lines(2)  \nSpecify that each stem has a width of 5 (equivalent to above)  \nstem v1, width(5)  \nStem-and-leaf plot for v2 with an interval of 100  \nstem v2, digits(2)  \nSame as above, with 4 lines per interval of 100  \nstem v2, digits(2) lines(4)  \nDisplay v2 rounded to the nearest hundred  \nstem v2, round(100) Do not display empty stems  \nstem v2, prune  \nMenu  \nStatistics > Summaries, tables, and tests > Distributional plots and tests > Stem-and-leaf display  \nSyntax  \nstem varname [ if ] [ in ] [ , options ]  \noptions Description  \n\n| Main\u003Cbr>prune round(\\#)\u003Cbr>truncate(\\#)\u003Cbr>digits(\\#)\u003Cbr>lines(\\#)\u003Cbr>width(\\#) | do not print stems that have no leaves\u003Cbr>round data to this value; default is round(1)\u003Cbr>truncate data to this value\u003Cbr>digits per leaf; default is digits(1)\u003Cbr>number of stems per interval of 10digits\u003Cbr>stem width; equal to 10digits /width |\n| --- | --- |\n\nby and collect are allowed; see [U] 11.1.10 Prefix commands.  \nOptions  \n􀀃 􀀀  \n  Main    \n􀀃 􀀀  \nprune prevents printing any stems that have no leaves.  \nround(\\#) rounds the data to this value and displays the plot in these units. If round() is not specified, noninteger data will be rounded automatically.  \ntruncate(\\#) truncates the data to this value and displays the plot in these units.  \ndigits(\\#) sets the number of digits per leaf. The default is 1 .  \nlines(\\#) sets the number of stems per every data interval of 10digits. The value of lines() must divide 10digits ; that is, if digits(1) is specified, then lines() must divide 10 . If digits(2) is specified, then lines() must divide 100, etc. Only one of lines() or width() may be specified. If neither is specified, an appropriate value will be set automatically.  \nwidth(\\#) sets the width ofa stem. lines() is equal to 10digits /width, and this option is merely an alternative way of setting lines() . The value of width() must divide 10digits. Only one of width() or lines() may be specified. If neither is specified, an appropriate value will be set automatically.  \nNote: If lines() or width() is not specified, digits() may be decreased in some circumstances to make a better-looking plot. If lines() or width() is set, the user-specified value of digits() will not be altered.  \nRemarks and examples  \n Example 1  \nStem-and-leaf displays are a compact way to present considerable information about a batch of data. For instance, using our automobile data (described in [U] 1.2.2 Example datasets):  \n. use [https://www.stata-press.com/data/r19/auto](https://www.stata-press.com/data/r19/auto)[ ](https://www.stata-press.com/data/r19/auto)(1978 automobile data)  \n. stem mpg  \nStem-and-leaf plot for mpg (Mileage (mpg))  \n1t  \n1f  \n1s  \n1.  \n2*  \n2t  \n2f  \n2s  \n2.  \n3*  \n3t  \n3f  \n3s  \n3.  \n4*  \n22  \n4444445566667777 88888888899999999 00011111 22222333 444455555  \n666  \n8889  \n001  \n455  \n1  \nThe stem-and-leaf display provides a way to list our data. The expression to the left of the vertical bar is called the stem; the digits to the right are called the leaves. All the stems that begin with the same digit and the corresponding leaves, written beside each other, reconstruct an observation of the data. Thus, if we look at the four stems that begin with the digit 1 and their corresponding leaves, we see that we have two cars rated at 12 mpg, 6 cars at 14, 2 at 15, and so on. The car with the highest mileage rating in our data is rated at 41 mpg.  \nThe above plot is a five-line plot with lines() equal to 5 (five lines per interval of 10) and width() equal to 2 (two leaves per stem) .  \nInstead, we could specify lines(2) :  \n. stem mpg, lines(2)  \nStem-and-leaf plot for mpg (Mileage (mpg))  \n1*  \n1.  \n2*  \n2.  \n3*  \n3.  \n4* ","cbCaihaWoohoHhpG","https://ap.wps.com/l/cbCaihaWoohoHhpG","pdf",130824,"English","# stem displays stem-and-leaf plots\n## Quick start\n## Syntax\n## Options\n## Remarks and examples\n## Stored results","[{\"question\":\"What are stem and leaves in a stem-and-leaf plot?\",\"answer\":\"The expression on the left of the vertical bar is the stem, and the digits on the right are the leaves. Stems with the same starting digit, together with their leaves, reconstruct the underlying observations.\"},{\"question\":\"How do prune, round(), and truncate() affect the plot?\",\"answer\":\"prune prevents printing stems that have no leaves. round(#) rounds data to the specified units before displaying the plot, while truncate(#) truncates data to those units for display.\"},{\"question\":\"How do digits(), lines(), and width() control the layout?\",\"answer\":\"digits(#) sets the number of digits per leaf. lines(#) sets the number of stems per every data interval of 10^digits and must divide 10^digits; width(#) sets the stem width, with lines() equivalent to 10^digits / width. Only one of lines() or width() may be specified.\"}]","stem - Stem-and-leaf display - Syntax Options and Examples | PDF",13,[145,149,153,157],{"page_no":22,"url":146,"width":147,"height":148},"https://res-academy.cache.wpscdn.com/upload/kdocshare/2026-11-12/bbe133471c1212c54bcedde29ea9f79c.webp",983,1403,{"page_no":26,"url":150,"width":151,"height":152},"https://res-academy.cache.wpscdn.com/upload/kdocshare/2026-11-12/28a7e45fbadf3369a2b7f7b8bbcd886c.webp",982,1402,{"page_no":30,"url":154,"width":155,"height":156},"https://res-academy.cache.wpscdn.com/upload/kdocshare/2026-11-12/a6505dcc6eb5ce1e76ca77f6c6b7f290.webp",981,1400,{"page_no":33,"url":158,"width":159,"height":160},"https://res-academy.cache.wpscdn.com/upload/kdocshare/2026-11-12/4eece7c86e1a6aac2d96d7eb8ef1bf37.webp",980,1399,{"list":162,"token":11},[163,170,176,182,189,195,199,205,211,217],{"doc_id":164,"doc_title":165,"file_type":137,"home_preview_img_url":166,"slug":167,"view_count":168,"category_name":29,"create_tm":169},199195,"CONFUZZLE - A Wordlist","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110229863680733/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796110559&Signature=K3ST0T32OnQg4KXZ9ZN12fpAz5M%3D","confuzzle-a-wordlist",16,1788505065,{"doc_id":171,"doc_title":172,"file_type":137,"home_preview_img_url":173,"slug":174,"view_count":30,"category_name":29,"create_tm":175},680526,"Stem Direction - Resources","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110229997996801/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796110559&Signature=RQn3ZNMA0PmqynDyH8i9ETtdKL4%3D","stem-direction-resources",1793917429,{"doc_id":177,"doc_title":178,"file_type":137,"home_preview_img_url":179,"slug":180,"view_count":168,"category_name":29,"create_tm":181},389937,"Ball Valves - General Purpose and Special Application - 60 Series","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110229917148082/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796110559&Signature=cRElKiFdSO9AMUkkYIdgYEbUnwQ%3D","ball-valves-general-purpose-and-special-application-60-series",1790328557,{"doc_id":183,"doc_title":184,"file_type":137,"home_preview_img_url":185,"slug":186,"view_count":187,"category_name":29,"create_tm":188},297811,"TSA Teams - District Qualifiers - State Qualifiers","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110229905756539/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796110559&Signature=Ntrpsl9YsHQTpFpOjangRES%2BU0o%3D","tsa-teams-district-qualifiers-state-qualifiers",12,1789748175,{"doc_id":190,"doc_title":191,"file_type":137,"home_preview_img_url":192,"slug":193,"view_count":22,"category_name":29,"create_tm":194},759417,"domain-creates","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110230043180742/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796110559&Signature=6qXHPkzT0HA72%2BSrHIAueZP7pCs%3D","domain-creates-759417",1795811648,{"doc_id":196,"doc_title":191,"file_type":137,"home_preview_img_url":197,"slug":191,"view_count":33,"category_name":29,"create_tm":198},661288,"https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110229980274608/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796110559&Signature=f8Xopu8b7BigKy%2Bs6oJ%2FqaujwjY%3D",1793162399,{"doc_id":200,"doc_title":201,"file_type":137,"home_preview_img_url":202,"slug":203,"view_count":26,"category_name":29,"create_tm":204},701338,"WEB PAGE GUIDE - STEM Discovery Week Partner Application Steps 2018","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110230011589564/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796110559&Signature=H3qrO9dpsCvZ%2FuIHXDpaOh64sMg%3D","web-page-guide-stem-discovery-week-partner-application-steps-2018",1794527682,{"doc_id":206,"doc_title":207,"file_type":137,"home_preview_img_url":208,"slug":209,"view_count":22,"category_name":29,"create_tm":210},762183,"Chip Resistors Marking - Resistance Code","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110230045598989/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796110559&Signature=VLQgBhlpLP2FpJPm%2BZ2B2jCfXLc%3D","chip-resistors-marking-resistance-code",1795989892,{"doc_id":212,"doc_title":213,"file_type":137,"home_preview_img_url":214,"slug":215,"view_count":96,"category_name":29,"create_tm":216},670926,"Data Visualization with R - Course Overview - ggplot2 Lessons","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110229988353499/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796110559&Signature=O7mRrlptr761nNaYn0YeZut39M4%3D","data-visualization-with-r-course-overview-ggplot2-lessons",1793572729,{"doc_id":218,"doc_title":219,"file_type":137,"home_preview_img_url":220,"slug":221,"view_count":22,"category_name":29,"create_tm":222},760179,"TraxxTool - User Manual - v2.51.2","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110230044227510/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796110559&Signature=JqNZXXm%2FI4Xa5QVmc9RxhZY%2BCLk%3D","traxxtool-user-manual-v2512",1795898926]