Hello I have a question. I have one string variable which have 4 characters the first two are the houres a the two second are the minutes How can I Split that variable into to variable one for the houres and other for the minutes?
@EconometricsMelodyАй бұрын
Thank you for your question. I hope the following example clarifies your query: clear set obs 100 gen time = runiformint(1000, 2400) tostring time, replace gen hour = substr(time, 1, 2) // Extract the first two characters for the hour gen min = substr(time, 3, 2) // Extract the third and fourth characters for the minutes // Convert hour and min to numeric destring hour, replace destring min, replace
@sam_jun4 ай бұрын
thank you for your amazing videos. I want to ask you how to make lapgap xlabel on twoway line graph? in your case, the label is "good", "better", and "north", while in my case, the xlabel is a continuous year. Thank you
@EconometricsMelody4 ай бұрын
Thank you for reaching out to us. Replace the labels "good", "better", and "north" in `relabel()' with the desired year values. For example, say: "" graph bar inc (max) exp, bargap(-30) /// over(prov,relabel(1 "2021" 2 "2022")) I hope this answers your question.
@EconometricsMelody4 ай бұрын
Dear @andrespurmalino9653 , Please find the content of the log file below: clear *** Input -- end input a b c d 12 13 14 14 12 234 13 132 123 132 153 134 45 23 123 2435 12 13 14 14 12 234 13 132 123 132 153 134 45 23 123 2435 12 13 14 14 12 234 13 132 123 132 153 134 45 23 123 2435 12 13 14 14 12 234 13 132 123 132 153 134 45 23 123 2435 end rename a inc rename b exp rename c inf rename d age *** gen clear set obs 30 gen a = 300 in f // f for first replace a = 1200 in 2/15 replace a = 5 in 16/20 replace a = 30 in l // l for last replace a = 700 if a==. rename a inc gen b = 900 *** Data Editor clear
@andrespurmalino96534 ай бұрын
thank you for your kind...
@andrespurmalino96534 ай бұрын
can we get the log file?
@EconometricsMelody4 ай бұрын
clear * Input -- end input a b c d 12 13 14 14 12 234 13 132 123 132 153 134 45 23 123 2435 12 13 14 14 12 234 13 132 123 132 153 134 45 23 123 2435 12 13 14 14 12 234 13 132 123 132 153 134 45 23 123 2435 12 13 14 14 12 234 13 132 123 132 153 134 45 23 123 2435 end rename a inc rename b exp rename c inf rename d age * gen clear set obs 30 gen a = 300 in f // f for first replace a = 1200 in 2/15 replace a = 5 in 16/20 replace a = 30 in l // l for last replace a = 700 if a==. rename a inc gen b = 900 * Data Editor clear
@danielomondionyango71635 ай бұрын
good thanks
@adrientomps21026 ай бұрын
Please remove the music in the background, it's annoying....😢😢😢
@EconometricsMelody6 ай бұрын
Thank you for your comment. The latest videos are free from any background music.
@vahidshadram9089 Жыл бұрын
Very good job! Thanks
@Taylor-lm7gx Жыл бұрын
"Promo sm"
@adanetefera2890 Жыл бұрын
Very good summary of key graph commands in such short time. I was looking for this for quite awhile. Thank you.
@rupeshpoudel3468 Жыл бұрын
dhanyabaad.
@EconometricsMelody Жыл бұрын
04:51 Events (AB) and (BA``) are mutually exclusive events so p(AB n BA``) = 0. p(AB U BA``) = p(AB) + p(BA``) - p(AB n BA``) = p(AB) + p(BA``) - 0 Therefore, p(AB U BA``) = p(AB) + p(BA``)
@varunmiglani110 Жыл бұрын
How to get variable labels, if there are multiple variable in tabstat command
@EconometricsMelody Жыл бұрын
cls clear set obs 3000 * creating categorical variables a, b, and c gen a = round(runiform()*1) gen b = round(runiform()*3) gen c = round(runiform()*4) * creating discrete or continuous variables d, e, and f gen d = round(runiform()*100) gen e = round(runiform()*500) gen f = round(runiform()*1000) * Labeling categorical variables a, b, and c label define a 0 "Male" 1 "Female" label values a a label define b 0 "Spring" 1 "Autumn" 2 "Winter" 3 "Summer" label values b b label define c 0 "Go" 1 "Sit" 2 "Stand" 3 "Relax" 4 "Move" label values c c ** operating tabstat command ## labels of categorical variable "a" is displayed tabstat d e f, by(a) statist(n mean sum p10 p50) /// col(stat) longstub ## labels of categorical variable "a" is displayed, across labels of categorical variable b bysort b : tabstat d e f, by(a) /// statist(n mean sum p10 p50) /// col(stat) longstub ## labels of categorical variable "a" is displayed, across labels of categorical variable b and c bysort b c : tabstat d e f, by(a) /// statist(n mean sum p10 p50) /// col(stat) longstub
@varunmiglani110 Жыл бұрын
@@EconometricsMelody thanks for reply, with this example, suppose variable d is weight, variable e is height. I want tabstat table to provide label of variables in table, i.e. weight and height to appear in table instead of d and e
@EconometricsMelody Жыл бұрын
@@varunmiglani110 Before you run the tabstat command, make sure you first label the variables, eg. label variable d "Weight" label variable e "height" Now you can run the tabstat command and get the desired results tabstat d e f, by(a) statist(n mean sum p10 p50) /// col(stat) longstub Look at this video kzbin.info/www/bejne/mquXdKKHbNGKeJY for a detailed understanding of labeling the variables and values.
@varunmiglani110 Жыл бұрын
@@EconometricsMelody the problem still persists , tried these commands, still variable names are displayed in table and not label of variable
@EconometricsMelody Жыл бұрын
@@varunmiglani110 With reference to Stata version 15, unlike the commands "table" and "tabulate," tabstat does not display the label of a variable. However, you can manually edit the variable name when preparing the table from the tabstat outputs, or you can rename the variable without any spaces. Here are some suggested variable namings: 1) Rename variable "d" to "weight" and rename variable "e" to "height": rename d weight rename e height Then you can use tabstat with the renamed variables: tabstat weight height f, by(a) 2) Alternatively, if you want to rename the variables with longer names, you can use the following approach: rename d weight_of_the_children_under_18 rename e height_of_the_children_under_18 Then you can use tabstat with the renamed variables: tabstat weight_of_the_children_under_18 height_of_the_children_under_18, by(a) Both of these approaches will allow you to manually edit the variable name or use renamed variables to display meaningful labels in the tabstat output.
@mahtabalam379 Жыл бұрын
Good explanation
@rajdeepchaudhuri7193 Жыл бұрын
love this thank you so much for this. literally helped me to transform a set of variables into observations which i couldnt find anywhere else
@VaishnaviTiwari-hc3mx Жыл бұрын
The music behind the video is not needed
@villageandanimals6986 Жыл бұрын
Great explanation. Thanks!
@otaviocanozziconceicao7195 Жыл бұрын
Hey my friend, please post a video on how to export regression tables from Stata to Excel, especially using the "outwrite" command (available from SSC). This would be great and extremely heplful, I guess that more people would also like to watch such video because your didactics is great! It could also be a separate playlist. Thank you!
@otaviocanozziconceicao7195 Жыл бұрын
Great video! Thank you
@christianosei96052 жыл бұрын
This is great. Saves so much time. Is it possible to share the do files
@otavioconceicao47802 жыл бұрын
Great! Thanks for one more great class
@otavioconceicao47802 жыл бұрын
Great video!!
@muddisneakers2 жыл бұрын
AWESOME content! Thank you so much. Great teacher at engaging presentation speed. I had some trouble understanding some of the audio quality.
@pimhoogland57042 жыл бұрын
You saved me so much time, thank you very much sir
@amartyaprem79482 жыл бұрын
Thank you very much. This is super helpful.
@otaviocanozziconceicao71952 жыл бұрын
Great work, thanks for producing this public good!
@EconometricsMelody2 жыл бұрын
@2:35 gen c = a if a==b [This is the easiest way to generate a variable "c" with values equal to variables "a" and "b". We used forvalues loop only to reinforce our understanding of referencing nth value of any variable.]
@otaviocanozziconceicao71952 жыл бұрын
Great job!
@Mir_sab2 жыл бұрын
Sir how to write "doitnowok".
@Mir_sab2 жыл бұрын
How to remove extra space from the column?
@EconometricsMelody2 жыл бұрын
clear set obs 10 gen a = " do it now ok " split a, gen(m) gen b = m1+m2+m3+m4 order a b
@EconometricsMelody2 жыл бұрын
clear set obs 10 gen a = " do it now ok " split a, gen(m) egen b = concat(m*) order a b
@EconometricsMelody2 жыл бұрын
kzbin.info/www/bejne/pKHCi4yVf6ySbck
@EconometricsMelody2 жыл бұрын
kzbin.info/www/bejne/l6WoeaWCorWbgbc
@ferv88142 жыл бұрын
thank u!!!
@KuldeepSingh-kq9yj2 жыл бұрын
if we want to numeric variable and string variable can we do that? like in d variable instead of do we want to add any any variable with numeric value given in our data set ? example 23adf
@EconometricsMelody2 жыл бұрын
clear set obs 12 gen a =23 gen b = "adf" gen c = string(a)+b
@EconometricsMelody2 жыл бұрын
egen d = concat(a b), punct("")
@kanahiwot20063 жыл бұрын
?1,:.
@otaviocanozziconceicao71953 жыл бұрын
Great tutorial, as always! Congrats again!!!!
@EconometricsMelody3 жыл бұрын
Thank you very much. It means a lot to us.
@otaviocanozziconceicao71953 жыл бұрын
Congratulations for these great classes. Thank you for producing these public goods!!! It would be great If you could launch classes about time series in Stata
@cristhianchavezocampo83023 жыл бұрын
This is very useful! Thank you so much
@otavioconceicao47803 жыл бұрын
Congrats for your great job! Keep on doing that and thanks for producing a valuable public good!
@EconometricsMelody3 жыл бұрын
Than you very much. It means a lot to us.
@otavioconceicao47803 жыл бұрын
Very nice! Congrats!
@EconometricsMelody3 жыл бұрын
Thank you very much
@otaviocanozziconceicao71953 жыл бұрын
Congratulations! Very didactic, thank you for providing this public good! Keep on making the videos!
@EconometricsMelody3 жыл бұрын
Thank you very much ...
@chitwambimakungu76423 жыл бұрын
Nice keep it up!!
@EconometricsMelody3 жыл бұрын
Thank you very much Chitwambi Makungu
@benysmart16433 жыл бұрын
thank you so much
@EconometricsMelody3 жыл бұрын
Thank you Beny smart
@ghofranghofran32653 жыл бұрын
Really useful !! Thank you so much
@EconometricsMelody3 жыл бұрын
Thank you very much Ghofran Ghofran
@KrishnaHariBaral33 жыл бұрын
5:42 cross-sectional variable or data
@KrishnaHariBaral33 жыл бұрын
1:15 the seed of mango should produce mango every time no matter where you sow it