[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"detail-sidebar-cat-0-en-105":3,"doc-seo-315303-105":59,"doc-detail-315303-en":131},{"code":4,"msg":5,"data":6},0,"success",[7,13,18,23,28,33,38,43,48,51,55],{"id":8,"doc_module":4,"doc_module_name":9,"category_name":10,"show_sort_weight":11,"slug":12},1,"Document","Story & Novel",90,"story-novel",{"id":14,"doc_module":4,"doc_module_name":9,"category_name":15,"show_sort_weight":16,"slug":17},2,"Literature",80,"literature",{"id":19,"doc_module":4,"doc_module_name":9,"category_name":20,"show_sort_weight":21,"slug":22},4,"Exam",70,"exam",{"id":24,"doc_module":4,"doc_module_name":9,"category_name":25,"show_sort_weight":26,"slug":27},5,"Comic",60,"comic",{"id":29,"doc_module":4,"doc_module_name":9,"category_name":30,"show_sort_weight":31,"slug":32},6,"Technology",50,"technology",{"id":34,"doc_module":4,"doc_module_name":9,"category_name":35,"show_sort_weight":36,"slug":37},7,"Healthcare",40,"healthcare",{"id":39,"doc_module":4,"doc_module_name":9,"category_name":40,"show_sort_weight":41,"slug":42},8,"Research & Report",30,"research-report",{"id":44,"doc_module":4,"doc_module_name":9,"category_name":45,"show_sort_weight":46,"slug":47},9,"Religion & Spirituality",20,"religion-spirituality",{"id":46,"doc_module":4,"doc_module_name":9,"category_name":49,"show_sort_weight":46,"slug":50},"World Cup","world-cup",{"id":52,"doc_module":4,"doc_module_name":9,"category_name":53,"show_sort_weight":52,"slug":54},10,"Lifestyle","lifestyle",{"id":56,"doc_module":4,"doc_module_name":9,"category_name":57,"show_sort_weight":24,"slug":58},19,"General","general",{"code":4,"msg":60,"data":61},"ok",{"site_id":62,"language":63,"slug":64,"title":65,"keywords":66,"description":67,"schema_data":68,"social_meta":124,"head_meta":126,"extra_data":128,"updated_unix":130},105,"en","panel-data-analysis-fixed-and-random-effects-using-stata","Panel Data Analysis - Fixed and Random Effects - using Stata","","Panel Data Analysis with a focus on Fixed and Random Effects using Stata (v. 6.0). Introduces panel data as longitudinal or cross-sectional time-series data where entities are observed over time, defining the typical notation (Xit, Yit) and giving examples of entity-year structures. Explains how to prepare data in long form, requiring variables in columns and entity/time in rows. Discusses wide-to-long reshaping in Stata, including reshape commands and practical handling of numeric column names and entity-in-column layouts.",{"@graph":69,"@context":123},[70,84,106],{"@type":71,"itemListElement":72},"BreadcrumbList",[73,77,79,82],{"item":74,"name":75,"@type":76,"position":8},"https://docshare.wps.com","Home","ListItem",{"item":78,"name":9,"@type":76,"position":14},"https://docshare.wps.com/document/",{"item":80,"name":30,"@type":76,"position":81},"https://docshare.wps.com/document/technology/",3,{"item":83,"name":65,"@type":76,"position":19},"https://docshare.wps.com/document/panel-data-analysis-fixed-and-random-effects-using-stata/315303/",{"url":83,"name":65,"@type":85,"image":86,"author":91,"headline":65,"publisher":94,"fileFormat":97,"inLanguage":63,"description":67,"dateModified":98,"datePublished":99,"encodingFormat":97,"isAccessibleForFree":100,"interactionStatistic":101},"DigitalDocument",{"url":87,"@type":88,"width":89,"height":90},"https://docshare.wps.com/thumbnails/panel-data-analysis-fixed-and-random-effects-using-stata/315303.png","ImageObject",300,407,{"name":92,"@type":93},"Ben ","Person",{"url":74,"name":95,"@type":96},"DocShare","Organization","application/pdf","2026-11-21","2026-09-20",true,{"@type":102,"interactionType":103,"userInteractionCount":105},"InteractionCounter",{"@type":104},"ViewAction",13,{"@type":107,"mainEntity":108},"FAQPage",[109,115,119],{"name":110,"@type":111,"acceptedAnswer":112},"What is panel data in this material?","Question",{"text":113,"@type":114},"Panel data is a dataset where entities are observed across time, also described as longitudinal or cross-sectional time-series data.","Answer",{"name":116,"@type":111,"acceptedAnswer":117},"What does “long form” mean for panel data?",{"text":118,"@type":114},"Variables should be in columns and entity and time should be in rows; this structure is called long form.",{"name":120,"@type":111,"acceptedAnswer":121},"How do you reshape wide-form data in Stata for panel analysis?",{"text":122,"@type":114},"Use Stata’s reshape command (e.g., reshape long ...) and ensure numeric column names are handled by adding a letter prefix before importing.","https://schema.org",{"og:url":83,"og:type":125,"og:title":65,"og:site_name":95,"og:description":67},"article",{"robots":127,"canonical":83},"index,follow",{"doc_id":129,"site_id":62},315303,1790172130,{"code":4,"msg":5,"data":132},{"doc_id":129,"user_id":133,"nickname":92,"user_avatar":134,"doc_module":4,"category_id":29,"category_name":30,"doc_title":65,"doc_description":67,"doc_content":135,"file_id":136,"file_url":137,"file_type":138,"file_size":139,"view_count":105,"is_deleted":4,"is_public":8,"is_downloadable":8,"audit_status":8,"page_count":140,"language":141,"language_code":63,"site_id":62,"html_lang":63,"table_of_contents":142,"faqs":143,"seo_title":144,"seo_description":67,"update_tm":145,"read_time":146,"preview_page_count":29,"preview_urls":147},2336478951081,"https://ap-avatar.wpscdn.com/davatar_276721f389ce27ea32af1340a28f341c","Panel Data Analysis  \nFixed and Random Effects  \nusing Stata  \n(v. 6.0)  \nOscar Torres-Reyna  \n[otorres@princeton.edu](otorres@princeton.edu)  \nDecember 2007 [http://www.princeton.edu/~otorres/](http://www.princeton.edu/~otorres/)  \nWhat panel data looks like…  \nPanel data (also known as longitudinal or crosssectional time-series data) is a dataset in which the behavior of entities (i) are observed across time (t) .  \n(Xit, Yit), i=1,…n; t=1,…T  \nThese entities could be states, companies, families, individuals, countries, etc.  \n\n| Entity | Year | Y | X1 | X2 | X3 | ….. |\n| --- | --- | --- | --- | --- | --- | --- |\n| 1 | 1 | \\# | \\# | \\# | \\# | ….. |\n| 1 | 2 | \\# | \\# | \\# | \\# | ….. |\n| 1 | 3 | \\# | \\# | \\# | \\# | ….. |\n| : | : | : | : | : | : | : |\n| 2 | 1 | \\# | \\# | \\# | \\# | ….. |\n| 2 | 2 | \\# | \\# | \\# | \\# | ….. |\n| 2 | 3 | \\# | \\# | \\# | \\# | ….. |\n| : | : | : | : | : | : | : |\n| 3 | 1 | \\# | \\# | \\# | \\# | ….. |\n| 3 | 2 | \\# | \\# | \\# | \\# | ….. |\n| 3 | 3 | \\# | \\# | \\# | \\# | ….. |\n\nOTR See Stock and Watson, Introduction to Econometrics, chapter 10 “Regression with Panel Data”. 2  \nPreparing Data into Panel  \nData format  \nThe data: the long form  \nTo analyze panel data:  \n• Variables should be in columns.  \n• Entity and time in rows.  \nThis format is known as long form.  \n\n| Entity | Year | Y | X1 | X2 | X3 | ….. |\n| --- | --- | --- | --- | --- | --- | --- |\n| 1 | 1 | \\# | \\# | \\# | \\# | ….. |\n| 1 | 2 | \\# | \\# | \\# | \\# | ….. |\n| 1 | 3 | \\# | \\# | \\# | \\# | ….. |\n| : | : | : | : | : | : | : |\n| 2 | 1 | \\# | \\# | \\# | \\# | ….. |\n| 2 | 2 | \\# | \\# | \\# | \\# | ….. |\n| 2 | 3 | \\# | \\# | \\# | \\# | ….. |\n| : | : | : | : | : | : | : |\n| 3 | 1 | \\# | \\# | \\# | \\# | ….. |\n| 3 | 2 | \\# | \\# | \\# | \\# | ….. |\n| 3 | 3 | \\# | \\# | \\# | \\# | ….. |\n\nWide form data (time in columns)  \nIf your dataset is in wide format, either entity or time are in columns, you need to reshape it to long format (you can do this in Stata) .  \nBeware that Stata does not like numbers as column names. You need to add a letter to the numbers before importing into Stata. If you have something like the following:  \nWide form data (time in columns)  \nAdd a letter to the numeric column names, for example, an ‘x’ before the year:  \nImport into Stata  \nReshaping from wide to long  \nOnce in Stata, you can reshape it using the command reshape:  \ngen id =   n  \norder id  \nreshape long x , i(id) j(year)  \nrename x gdp  \nType help reshape for more details  \nWide form data (entity in columns)  \nIf the wide format data has the entities in column and time in rows, like this example:  \nWide form data (entity in columns)  \nImport it into Stata:  \nReshape wide to long format  \nOnce in Stata, you can reshape it using the command reshape:  \n* Adding the prefix ‘gdp’ to column names. Command ‘renvars’ is user-written, you need to install it, see note below  \nrenvars A-G, pref (gdp)  \ngen id =   n order id  \nreshape long gdp , i(id) j(country) str  \nOTR  \nType help reshape for more details. You need to install renvars, type: search renvars  \nClick on the link for dm88_ * then install.  \n10","cbCaihp5IiW3Y75w","https://ap.wps.com/l/cbCaihp5IiW3Y75w","pdf",2152383,58,"English","# What panel data looks like\n# Preparing data into panel\n## Data format: long form\n## Data format: wide form and reshaping in Stata","[{\"question\":\"What is panel data in this material?\",\"answer\":\"Panel data is a dataset where entities are observed across time, also described as longitudinal or cross-sectional time-series data.\"},{\"question\":\"What does “long form” mean for panel data?\",\"answer\":\"Variables should be in columns and entity and time should be in rows; this structure is called long form.\"},{\"question\":\"How do you reshape wide-form data in Stata for panel analysis?\",\"answer\":\"Use Stata’s reshape command (e.g., reshape long ...) and ensure numeric column names are handled by adding a letter prefix before importing.\"}]","Panel Data Analysis - Fixed and Random Effects - using Stata | PDF",1789904385,146,[148,152,156,160,164,167],{"page_no":8,"url":149,"width":150,"height":151},"https://res-academy.cache.wpscdn.com/upload/kdocshare/2026-11-08/21814b69f8cec916dc432327e8c74aa9.webp",983,737,{"page_no":14,"url":153,"width":154,"height":155},"https://res-academy.cache.wpscdn.com/upload/kdocshare/2026-11-08/756bcd9d21d9e6ad553007660fdf66a1.webp",982,736,{"page_no":81,"url":157,"width":158,"height":159},"https://res-academy.cache.wpscdn.com/upload/kdocshare/2026-11-08/34b46cdd4d8b188d3a25e875aaa4210a.webp",981,735,{"page_no":19,"url":161,"width":162,"height":163},"https://res-academy.cache.wpscdn.com/upload/kdocshare/2026-11-08/dd824b62bfa540f2ae81c0c2074f61a4.webp",980,734,{"page_no":24,"url":165,"width":166,"height":163},"https://res-academy.cache.wpscdn.com/upload/kdocshare/2026-11-08/4f8c2b3b925e8630a5910befa40ebb66.webp",979,{"page_no":29,"url":168,"width":169,"height":170},"https://res-academy.cache.wpscdn.com/upload/kdocshare/2026-11-08/8c3cf38dfd4b52764582708f0b279683.webp",978,733]