![]() Input str5 A str97 Companyname str14 BvDIDnumber str17(Turnover2015 Turnover2016 Turnover2017) int Numberofdirectorsmanagers str3 DMAge str1 DMGender float firm_id Could you show me to attach id to companies and convert wide to long format (my data has some missing values for colume Turnover 2015,2016,2017) ? The firm_id starts with 452 instead of 1. It also makes it possible for those who want to help you to create a faithful representation of your example to try out their code, which in turn makes it more likely that their answer will actually work in your data.īelow is the example of my data. It includes complete information about aspects of the data that are often critical to answering your question but cannot be seen from tabular displays or screenshots. dataex- will save you time it is easier and quicker than typing out tables. Either way, run -help dataex- to read the simple instructions for using it. If not, run -ssc install dataex- to get it. If you are running version 17, 16 or a fully updated version 15.1 or 14.2, -dataex- is already part of your official Stata installation. How the data looks in Excel does not provide important information, such as whether a variable like DMAge is a string or numeric. It is the Stata data that is critical to providing you with code and advice that will actually work. Then use the -dataex- command to show example data. Many of us won't download any attachments from people we don't know, especially not Microsoft Office documents, which can contain active malware. If you need more specific advice you need to post back. To get the proportion of females: -bysort companyname: egen proportion_female = mean(DM_Gender = "F"). If it is actually a string variable, then run -destring DMAge, replace- first. However, assuming that age variable is really numeric, -bysort companyname: egen average_age = mean(DMAge)- will give you the mean age. ![]() The purpose of -encode- is entirely different I won't elaborate on that here. Such a variable, if Stata has it as a string variable, should be converted to numeric using -destring-, not -encode. For future reference, never use -encode- on a variable that, to human eyes, looks like a number. Either it will give you an error message (if DMAge is already numeric within Stata) or it will give you incorrect results (if it was for some reason a string variable in Stata). encoding- this variable is definitely the wrong thing to do. I use the command bysort companyname: egen average_age = mean(Age) after encode the variable DMAge but it doesn't work. MHRA 'BVD', All Acronyms, 17 September 2023, Bluebook All Acronyms, BVD (Sep. BVD, All Acronyms, viewed September 17, 2023, MLA All Acronyms. Retrieved September 17, 2023, from Chicago All Acronyms. Facebook Twitter Linkedin Quote Copy APA All Acronyms.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |