Stata: Rename and Labeling
belajar stata
[{'start': '6.799', 'end': '12.759', 'text': 'assalamualaikum warahmatullahi wabarakatuh welcome to the'}, {'start': '12.759', 'end': '21.279', 'text': 'Stata Learning channel, this is a channel where we can exchange ideas, exchange'}, {'start': '21.279', 'end': '28.119', 'text': 'tips and learn about the Stata application,'}, {'start': '28.119', 'end': '36.200', 'text': 'friends, this is my first video and we will start learning'}, {'start': '36.200', 'end': '42.000', 'text': 'to use Stata from the beginning, so maybe for colleagues who often'}, {'start': '42.000', 'end': '48.280', 'text': 'use Stata or at least have never used Stata, you can'}, {'start': '48.280', 'end': '56.160', 'text': 'skip this video first, but if you want to watch'}, {'start': '56.160', 'end': '60.840', 'text': 'this video until the end, maybe you can give tips'}, {'start': '60.840', 'end': '70.080', 'text': 'on using Start for viewers so they can be more effective in using it.'}, {'start': '70.080', 'end': '79.640', 'text': 'Stata, okay, we will soon get acquainted with the Stata application,'}, {'start': '81.680', 'end': '86.960', 'text': "it's open, yes, colleagues, this is the Stata application and what I am using"}, {'start': '86.960', 'end': '92.680', 'text': 'is Stata version 16.1. If there are colleagues who'}, {'start': '92.680', 'end': '98.520', 'text': "use the Stata application which is different from this application, it doesn't matter because in"}, {'start': '98.520', 'end': '103.439', 'text': 'principle the commands are the same as'}, {'start': '103.439', 'end': '108.640', 'text': "the latest version. If I'm not mistaken, it has reached version 19. Yes,"}, {'start': '108.640', 'end': '112.119', 'text': 'colleagues,'}, {'start': '112.399', 'end': '118.719', 'text': 'well, in front of the monitor screen, we can see that there are several'}, {'start': '118.719', 'end': '124.360', 'text': 'windows with each function, the biggest one in'}, {'start': '124.360', 'end': '132.319', 'text': 'the middle, where the cursor is, is the window that will display the output.'}, {'start': '132.319', 'end': '139.000', 'text': 'from the commands that we give while below this is the'}, {'start': '139.000', 'end': '144.360', 'text': 'Windows comen so this is the window for entering'}, {'start': '144.360', 'end': '153.519', 'text': 'commands on the right there are two top and bottom, this top will then'}, {'start': '153.519', 'end': '161.319', 'text': 'bring up the variables that we have while below this will'}, {'start': '161.319', 'end': '168.640', 'text': 'bring up property information for the variables that we chose so later we'}, {'start': '168.640', 'end': '176.080', 'text': 'will be able to see the name of the variable label if there is a data type and so on'}, {'start': '176.080', 'end': '180.920', 'text': 'while on the far left here'}, {'start': '180.920', 'end': '187.120', 'text': 'is a window for bringing up the history of'}, {'start': '187.120', 'end': '194.440', 'text': 'the commands that we entered so later we will slowly'}, {'start': '194.440', 'end': '202.799', 'text': 'use ee further processing on the history which we will export to a do'}, {'start': '202.799', 'end': '208.080', 'text': 'file or we will also do command via do file, so what is a do'}, {'start': '208.080', 'end': '214.400', 'text': 'file, I will explain in a separate video,'}, {'start': '218.159', 'end': '225.400', 'text': 'next we will learn to enter data into the'}, {'start': '225.400', 'end': '231.480', 'text': 'Stata application, we can input data in various'}, {'start': '231.480', 'end': '238.040', 'text': 'ways, the first is manual input'}, {'start': '238.040', 'end': '246.040', 'text': 'and copy paste, so we can do this by pressing'}, {'start': '246.040', 'end': '251.840', 'text': 'or opening ee, the data'}, {'start': '251.840', 'end': '259.840', 'text': 'editor display, so I repeat, in the top toolbar, there is a data'}, {'start': '259.840', 'end': '265.400', 'text': 'editor, we can press ee on the left, which edits, so'}, {'start': '265.400', 'end': '271.840', 'text': 'this is so that we can input it, so we can manually input'}, {'start': '271.840', 'end': '279.840', 'text': 'the data with variable names 1 2 and so on, or we can also'}, {'start': '279.840', 'end': '288.400', 'text': 'copy paste, so for example, I have opened from Excel and'}, {'start': '288.400', 'end': '297.360', 'text': 'I will do this copy paste, I copy and paste here,'}, {'start': '297.360', 'end': '304.919', 'text': 'it will automatically display data from variables'}, {'start': '304.919', 'end': '315.400', 'text': '1 to 6 with a number of observations of 32 and on the right it will also display'}, {'start': '315.400', 'end': '324.800', 'text': 'a list of variables that we have, so if we close the data, it is already'}, {'start': '324.800', 'end': '330.840', 'text': 'loaded in Stata memory, now here we can see the list of'}, {'start': '330.840', 'end': '337.240', 'text': 'variables and here is'}, {'start': '337.240', 'end': '345.039', 'text': 'the variable name, label, and so on, so here are the properties of'}, {'start': '345.039', 'end': '350.680', 'text': 'the variables here, for example, if I click on number one or'}, {'start': '350.680', 'end': '357.199', 'text': "variable 1, here the name of variable 1 will appear with the label. it's still empty"}, {'start': '357.199', 'end': '363.800', 'text': "because we haven't filled it in here, so we'll learn the"}, {'start': '363.800', 'end': '368.360', 'text': "second way first. To do that, we'll"}, {'start': '368.360', 'end': '372.000', 'text': 'first clean the memory,'}, {'start': '372.000', 'end': '381.000', 'text': "ee, by typing drop, then und all, so we'll"}, {'start': '381.000', 'end': '387.000', 'text': 'delete variables 1 to 6 from Stata memory.'}, {'start': '387.000', 'end': '394.520', 'text': "Well, if we enter, it's clean again and here the memory of"}, {'start': '394.520', 'end': '399.240', 'text': 'the command we just did'}, {'start': '399.240', 'end': '405.400', 'text': 'has been saved . The next way is by ee'}, {'start': '405.400', 'end': '413.919', 'text': 'import, so Stata supports various data formats, so we see'}, {'start': '413.919', 'end': '421.160', 'text': 'here in the import menu, we can see various file extensions that'}, {'start': '421.160', 'end': '428.360', 'text': 'we can open, so I will For example, from Excel, again'}, {'start': '428.360', 'end': '432.759', 'text': 'we look for the Excel that we'}, {'start': '433.280', 'end': '438.919', 'text': 'have, so for example, if I'}, {'start': '438.919', 'end': '442.160', 'text': 'select'}, {'start': '447.599', 'end': '453.240', 'text': 'here, we select the one that'}, {'start': '453.240', 'end': '459.160', 'text': 'is still in shape, for example,'}, {'start': '459.599', 'end': '467.319', 'text': 'this is Mile 1 and here the data that will appear will appear. We will see that in the'}, {'start': '467.319', 'end': '474.240', 'text': 'top row, this is the file name, so if we immediately press OK, then later'}, {'start': '474.240', 'end': '482.879', 'text': 'the data will be wrong, because then in the top row there will be an error.'}, {'start': '482.879', 'end': '486.440', 'text': 'data inconsistency because the first one is a string, the next one'}, {'start': '486.440', 'end': '492.080', 'text': 'is the ee number, for that we need'}, {'start': '492.080', 'end': '498.759', 'text': 'to tell Stata that the first line is the name of the variable so that if'}, {'start': '498.759', 'end': '505.360', 'text': 'we press the check mark'}, {'start': '505.360', 'end': '512.760', 'text': 'here the data will be more organized'}, {'start': '512.760', 'end': '521.959', 'text': 'we press okay'}, {'start': '521.959', 'end': '528.040', 'text': 'and here four variables appear with'}, {'start': '528.040', 'end': '532.480', 'text': 'the first'}, {'start': '532.480', 'end': '544.120', 'text': 'variables ID X1 X2 and X3 with labels ID and X1'}, {'start': '550.240', 'end': '554.800', 'text': 'to'}, {'start': '554.800', 'end': '561.839', 'text': 'variable renaming and'}, {'start': '561.839', 'end': '569.000', 'text': 'labeling, so we will fill in labels both on'}, {'start': '569.000', 'end': '574.959', 'text': 'variables and labels on values, so if there is a dami variable, colleagues,'}, {'start': '574.959', 'end': '581.320', 'text': 'for example 0 and 1, for example 0 is gender, yes, if the gender number is 0, it is'}, {'start': '581.320', 'end': '590.480', 'text': 'male and one female, then we can do labeling on the'}, {'start': '590.480', 'end': '596.600', 'text': 'variable value, so friends can immediately follow the practice, we'}, {'start': '596.600', 'end': '602.959', 'text': 'can use the data provided by Stata,'}, {'start': '603.200', 'end': '608.279', 'text': 'I will clean this data first, colleagues,'}, {'start': '608.279', 'end': '616.720', 'text': 'yes, we can use this auto data provided by Stata, we'}, {'start': '616.720', 'end': '624.240', 'text': 'just need to call it with the command webuse auto.dta'}, {'start': '624.240', 'end': '631.120', 'text': 'so DTA is an extension of ee fileata, yes, colleagues,'}, {'start': '631.120', 'end': '636.720', 'text': 'the purpose of which is to store data'}, {'start': '637.639', 'end': '642.920', 'text': ', of course, colleagues, you have to be connected to the internet and we'}, {'start': '642.920', 'end': '648.760', 'text': 'can see that on the right,'}, {'start': '648.760', 'end': '656.320', 'text': 'the variables contained in the auto.dta file have appeared'}, {'start': '657.320', 'end': '662.639', 'text': 'here, there is make and here'}, {'start': '662.639', 'end': '671.000', 'text': 'the variable labels have also been filled in. Yes, colleagues, for example, here there is make and model,'}, {'start': '671.000', 'end': '675.120', 'text': 'then price and so on,'}, {'start': '675.959', 'end': '685.000', 'text': 'then if we look in the data editor, yes, we can see that in the'}, {'start': '685.000', 'end': '689.519', 'text': 'MAC variable, this yellow writing'}, {'start': '689.519', 'end': '695.440', 'text': 'means that ee, this variable is a string, so Well, if'}, {'start': '695.440', 'end': '701.959', 'text': "it's a string then we can't do statistical analysis,"}, {'start': '701.959', 'end': '707.760', 'text': "while for the others it's white, this means an integer or number, which means"}, {'start': '707.760', 'end': '713.440', 'text': 'we can do mathematical and statistical functions, so'}, {'start': '713.440', 'end': '720.000', 'text': "in the foreign column, let's look for a moment, so we"}, {'start': '720.000', 'end': '725.959', 'text': 'can see, colleagues, here the words domestic and foreign'}, {'start': '725.959', 'end': '732.800', 'text': 'are written below in blue, this means writing, but actually'}, {'start': '732.800', 'end': '740.519', 'text': 'the numbers are dami numbers, so domestic and foreign are labels, we can'}, {'start': '740.519', 'end': '747.800', 'text': 'see here we can display the original data, so we'}, {'start': '747.800', 'end': '754.760', 'text': 'hide the labels and we can see here the original values \u200b\u200bare 0'}, {'start': '754.760', 'end': '758.480', 'text': 'and 1'}, {'start': '758.480', 'end': '767.519', 'text': 'with label 0 is domestic and one is foreign, so we will'}, {'start': '767.519', 'end': '772.800', 'text': 'learn how to create and'}, {'start': '772.800', 'end': '777.519', 'text': 'edit labels, yes, colleagues.'}, {'start': '779.399', 'end': '788.040', 'text': 'Yes, to rename, rename, we can use the command'}, {'start': '788.040', 'end': '795.519', 'text': 'according to ee in English, namely rename, followed by the variable that'}, {'start': '795.519', 'end': '803.560', 'text': 'we want to change the name of, for example, we type'}, {'start': '803.560', 'end': '811.839', 'text': 'price, so we want to rename the price variable with the name of'}, {'start': '811.839', 'end': '814.839', 'text': 'the price variable'}, {'start': '815.399', 'end': '821.279', 'text': ', so in Stata, colleagues, ee, the use of uppercase'}, {'start': '821.279', 'end': '827.480', 'text': 'and lowercase letters is very sensitive, so'}, {'start': '827.480', 'end': '836.320', 'text': 'this command can only be done with lowercase letters, while'}, {'start': '836.320', 'end': '844.480', 'text': 'variable names are uppercase. This is used if we do analysis with SAM or'}, {'start': '844.480', 'end': '850.360', 'text': 'structural equation models, so for'}, {'start': '850.360', 'end': '858.120', 'text': 'unobservable variables, the variable must start with an uppercase letter, at least the'}, {'start': '858.120', 'end': '865.240', 'text': 'first letter is uppercase, while for indicators, use lowercase letters'}, {'start': '865.240', 'end': '868.759', 'text': ', well, we will discuss that further in a'}, {'start': '868.759', 'end': '874.440', 'text': 'separate video, now we are learning to change the name of the variable price'}, {'start': '874.440', 'end': '880.279', 'text': 'to price, so if we press it, we see'}, {'start': '880.279', 'end': '886.720', 'text': 'variable number two, which was previously price, here we see the label'}, {'start': '886.720', 'end': '895.959', 'text': 'is still price, it has changed to price, you need to remember that too, friends,'}, {'start': '895.959', 'end': '902.360', 'text': 'like in other statistical applications, the naming of this variable is very limited'}, {'start': '902.360', 'end': '908.440', 'text': "so we can't do it. or give a variable name that contains"}, {'start': '908.440', 'end': '914.360', 'text': 'spaces, for example, if the name of this variable is long, then'}, {'start': '914.360', 'end': '923.279', 'text': 'we can write that information in the variable label. Well, to change the variable label,'}, {'start': '923.279', 'end': '927.399', 'text': 'for example, this is price, which we will write as'}, {'start': '927.399', 'end': '934.360', 'text': 'price, then we can do this labellink with the'}, {'start': '934.360', 'end': '937.360', 'text': 'label command.'}, {'start': '938.360', 'end': '945.279', 'text': 'variable, then we call the variable, namely price'}, {'start': '945.279', 'end': '950.839', 'text': ', then we call price, so price with ee in'}, {'start': '950.839', 'end': '959.519', 'text': 'capital letters, well, like this, then we will change the label that was previously written'}, {'start': '959.519', 'end': '968.600', 'text': 'price to price with capital letters in ee, the first letter of the word price'}, {'start': '968.600', 'end': '971.360', 'text': ', well, we see that'}, {'start': '971.360', 'end': '977.199', 'text': 'the label has changed, guys .'}, {'start': '979.480', 'end': '987.279', 'text': 'Next we will learn to do labeling for'}, {'start': '987.279', 'end': '994.079', 'text': 'value, well, in this auto.tta file, there is already one variable'}, {'start': '994.079', 'end': '998.279', 'text': 'that contains the value label, namely foreign'}, {'start': '998.279', 'end': '1004.880', 'text': 'or car type. Well, we can check ee what labels'}, {'start': '1004.880', 'end': '1012.639', 'text': 'are already in this file with the label list command'}, {'start': '1014.160', 'end': '1020.600', 'text': ", if we enter then that's it. or the name ee appears"}, {'start': '1020.600', 'end': '1030.919', 'text': ', yes, the name of the label, namely origin with ee, fill it in if the variable has a value of'}, {'start': '1030.919', 'end': '1042.120', 'text': '0 then it will be written domestic and 1 if eh foreign if 1 well we can change'}, {'start': '1042.120', 'end': '1047.480', 'text': 'this value OK Colleagues, the value 0 domestic 1 foreign with other languages'}, {'start': '1047.480', 'end': '1053.919', 'text': '\u200b\u200bor other writing ee as we like, so according to our needs'}, {'start': '1053.919', 'end': '1059.000', 'text': 'with the label'}, {'start': '1059.000', 'end': '1064.400', 'text': 'define command so we will redefine it'}, {'start': '1064.400', 'end': '1074.840', 'text': 'then the label name here is origin followed by the value 0, which'}, {'start': '1074.840', 'end': '1085.039', 'text': 'we will label and quote marks, for example domestic we will replace it with'}, {'start': '1085.200', 'end': '1088.200', 'text': 'the word'}, {'start': '1089.120', 'end': '1099.200', 'text': 'domestic vehicle while for one we'}, {'start': '1099.200', 'end': '1104.320', 'text': 'label the foreign vehicle,'}, {'start': '1105.440', 'end': '1112.000', 'text': 'so next, because what we are doing is not'}, {'start': '1112.000', 'end': '1118.039', 'text': 'making it from scratch but changing it, we have to give an order or'}, {'start': '1118.039', 'end': '1123.840', 'text': 'notification to Stata that this labeling is a modification, which means'}, {'start': '1123.840', 'end': '1127.480', 'text': 'we give the command'}, {'start': '1129.919', 'end': '1137.320', 'text': "modify, now it's finished, we can use the label list command to"}, {'start': '1137.320', 'end': '1144.480', 'text': 'see the results of our last command or comment,'}, {'start': '1144.480', 'end': '1150.720', 'text': "yes, it's changed, colleagues here. 0 changes to a"}, {'start': '1150.720', 'end': '1156.400', 'text': 'domestic vehicle and the value 1 changes to a'}, {'start': '1156.400', 'end': '1161.640', 'text': 'foreign vehicle. Well, if you want to make it from scratch, how can our colleagues'}, {'start': '1161.640', 'end': '1167.400', 'text': 'try the command, still label'}, {'start': '1167.400', 'end': '1172.000', 'text': 'define, colleagues, then followed by the name of'}, {'start': '1172.000', 'end': '1178.840', 'text': "the labeling, if here is the origin, let's try with the name of origin, that"}, {'start': '1178.840', 'end': '1186.559', 'text': "'s why, base on origin, well, then followed by"}, {'start': '1186.559', 'end': '1190.799', 'text': 'our value, again,'}, {'start': '1192.559', 'end': '1196.880', 'text': 'foreign vehicle,'}, {'start': '1197.880', 'end': '1205.039', 'text': 'oh domestic, yes, colleagues, yes, domestic vehicle,'}, {'start': '1205.039', 'end': '1211.240', 'text': "wow, that's wrong, then the value is"}, {'start': '1211.240', 'end': '1219.120', 'text': 'one, the value or the label is foreign vehicle,'}, {'start': '1224.400', 'end': '1232.159', 'text': 'well, this is the command to make the labeling.'}, {'start': '1232.159', 'end': '1238.760', 'text': 'This has already been done. We see in the label list'}, {'start': '1239.600', 'end': '1246.200', 'text': "there are already two, friends, origin and origin. Well, let's look at the BRI"}, {'start': '1246.200', 'end': '1251.360', 'text': "data here, it's still written in"}, {'start': '1252.120', 'end': '1259.080', 'text': "this country, actually you haven't used the original one, yes, it's still"}, {'start': '1259.080', 'end': '1264.200', 'text': 'the origin one. So, to attach this label'}, {'start': '1264.200', 'end': '1273.720', 'text': 'to a variable, the command is label value, followed by the name of'}, {'start': '1273.720', 'end': '1282.159', 'text': 'the variable, here it is foreign, then followed by the name of the label.'}, {'start': '1282.159', 'end': '1288.080', 'text': 'Well, here what appears is'}, {'start': '1288.080', 'end': '1294.480', 'text': 'the ee label based on the name.'}, {'start': '1294.480', 'end': '1300.200', 'text': "This origin label is not visible, because we entered it the same way. Let's try"}, {'start': '1300.200', 'end': '1304.080', 'text': 'changing it for the'}, {'start': '1307.279', 'end': '1310.960', 'text': 'origin label. Label'}, {'start': '1312.880', 'end': '1319.200', 'text': 'define zero car, that is,'}, {'start': '1319.200', 'end': '1324.039', 'text': 'domestic car'}, {'start': '1327.799', 'end': '1330.159', 'text': 'and'}, {'start': '1330.240', 'end': '1334.559', 'text': 'one'}, {'start': '1337.679', 'end': '1342.320', 'text': 'foreign car. Then we add the'}, {'start': '1342.799', 'end': '1350.480', 'text': 'modify command. Well, we see in the data editor that this has changed, yes, domestic car'}, {'start': '1350.480', 'end': '1358.440', 'text': 'and foreign car. Well, if we want the value to'}, {'start': '1358.440', 'end': '1365.520', 'text': 'be adjusted to the origin label, then we can do'}, {'start': '1365.520', 'end': '1371.559', 'text': 'the command label value, then we write it. the variable name'}, {'start': '1371.559', 'end': '1376.679', 'text': 'is foreign followed by the labeling name,'}, {'start': '1376.679', 'end': '1379.440', 'text': 'namely'}, {'start': '1379.640', 'end': '1386.360', 'text': 'origin, now we can see in the data editor, now it has changed again'}, {'start': '1386.360', 'end': '1394.120', 'text': 'to domestic vehicle and foreign vehicle, according to the value'}, {'start': '1394.120', 'end': '1397.520', 'text': 'on the'}, {'start': '1400.200', 'end': '1404.919', 'text': 'origin label, we will see the label'}, {'start': '1404.919', 'end': '1411.880', 'text': 'list, foreign cars and vehicles'}, {'start': '1411.880', 'end': '1419.080', 'text': 'for this origin label, we use the name of the car, while for the origin'}, {'start': '1419.080', 'end': '1424.640', 'text': 'vehicle we see here,'}, {'start': '1424.640', 'end': '1429.360', 'text': 'vehicle means the foreign variable is currently'}, {'start': '1429.360', 'end': '1435.880', 'text': 'using the origin label. If we want to change it back to origin or'}, {'start': '1435.880', 'end': '1441.960', 'text': 'follow the origin label, then we do label'}, {'start': '1441.960', 'end': '1447.200', 'text': 'value, followed by the name of'}, {'start': '1448.080', 'end': '1454.000', 'text': 'the variable, then followed by the name of the label that we will'}, {'start': '1455.960', 'end': '1463.440', 'text': 'use, we see, it has changed,'}, {'start': '1463.559', 'end': '1469.760', 'text': 'so colleagues For this labeling there are two types of labels'}, {'start': '1469.760', 'end': '1474.799', 'text': 'for variables and labels for inner ee values'}, {'start': '1474.799', 'end': '1481.440', 'text': 'variable, well, the command is simply to use ee followed by starting with'}, {'start': '1481.440', 'end': '1487.039', 'text': 'the label command, yes, for variables, then we write the'}, {'start': '1487.039', 'end': '1493.399', 'text': 'variable label, then the variable name, followed by the value or label that'}, {'start': '1493.399', 'end': '1501.279', 'text': 'we will write for the variable, while for the value, we use define to create'}, {'start': '1501.279', 'end': '1508.600', 'text': 'or edit an existing ee label,'}, {'start': '1509.200', 'end': '1515.399', 'text': 'maybe ee gets here first in the'}, {'start': '1515.399', 'end': '1522.840', 'text': 'first video, then we will continue in the next videos. If there are'}, {'start': '1522.840', 'end': '1529.440', 'text': 'colleagues who have requests about'}, {'start': '1529.440', 'end': '1537.480', 'text': 'more specific ee analysis using Stata, please write in the comments. So, colleagues,'}, {'start': '1537.480', 'end': '1544.360', 'text': 'we will end it first. Wassalamualaikum warahmatullahi wabarakatuh'}]