tag:blogger.com,1999:blog-2550386066385582083.post271365756932118345..comments2023-10-05T06:30:41.397-07:00Comments on R for Public Health: Converting a dataset from wide to longSlawa Rokickihttp://www.blogger.com/profile/17017311098539878072noreply@blogger.comBlogger12125tag:blogger.com,1999:blog-2550386066385582083.post-47646858076675366682013-10-04T20:13:53.029-07:002013-10-04T20:13:53.029-07:00Glad it was useful, great to hear your feedback!Glad it was useful, great to hear your feedback!Slawa Rokickihttps://www.blogger.com/profile/17017311098539878072noreply@blogger.comtag:blogger.com,1999:blog-2550386066385582083.post-85893075992177589252013-10-04T08:20:50.278-07:002013-10-04T08:20:50.278-07:00Thank-you. I always got hung up on the sep="...Thank-you. I always got hung up on the sep="" part of the command structure. You have cleared this up for me and given me a valuable tool!Doug Lawsonhttps://www.blogger.com/profile/11454885709941990550noreply@blogger.comtag:blogger.com,1999:blog-2550386066385582083.post-56276594940946411862013-10-04T05:36:38.138-07:002013-10-04T05:36:38.138-07:00Really impressed! It is so very informative inform...Really impressed! It is so very informative information. Each & every guidelines of your publish are amazing.<br /><br /><a href="http://www.buyfastlikes.org" rel="nofollow">purchase worldwide facebook fans</a><br /><a href="http://www.buyfastlikes.org" rel="nofollow">buy facebook likes/fans</a>Anonymoushttps://www.blogger.com/profile/08319602793362053011noreply@blogger.comtag:blogger.com,1999:blog-2550386066385582083.post-70495485420851874792013-09-09T01:40:23.728-07:002013-09-09T01:40:23.728-07:00I recently had to convert a dataset that I was wor...I recently had to convert a dataset that I was working with from a wide format to a long format for my analysis. I struggled with this a bit, but finally found the right sources and the right package to do it, so I thought I'd share my practical example of reshaping data in R. This post is specifically helpful for those using Demographic and Health Survey (DHS) data<br /><a href="http://ways2gettaller.eklablog.com/" rel="nofollow">http://ways2gettaller.eklablog.com/</a><br />Anonymoushttps://www.blogger.com/profile/09555312293786159305noreply@blogger.comtag:blogger.com,1999:blog-2550386066385582083.post-87722838072206117982013-06-20T07:58:37.155-07:002013-06-20T07:58:37.155-07:00I think you would do
reshape long b2 b4, i(casei...I think you would do <br /><br />reshape long b2 b4, i(caseid) j(childnumber)<br /><br />More help at this site: <br />http://www.ats.ucla.edu/stat/stata/modules/reshapel.htm<br />Slawa Rokickihttps://www.blogger.com/profile/17017311098539878072noreply@blogger.comtag:blogger.com,1999:blog-2550386066385582083.post-90255398243006920472013-06-19T07:03:01.150-07:002013-06-19T07:03:01.150-07:00hi Slawa have you got any idea how to do this in S...hi Slawa have you got any idea how to do this in STATA or the intuition on how to if you don't mind. im trying to have a dataset of all children born in my DHS datasetkelhttps://www.blogger.com/profile/12710848981170696961noreply@blogger.comtag:blogger.com,1999:blog-2550386066385582083.post-3268258739499294922013-06-19T07:00:19.899-07:002013-06-19T07:00:19.899-07:00hi Portia can you show me how to do this in STATA ...hi Portia can you show me how to do this in STATA or the intuition on how to if you don't mind. im trying to have a dataset of all children born in my DHS datasetkelhttps://www.blogger.com/profile/12710848981170696961noreply@blogger.comtag:blogger.com,1999:blog-2550386066385582083.post-12427197284972343922013-05-14T01:49:56.734-07:002013-05-14T01:49:56.734-07:00Wow, Fantastic Blog, it’s so helpful to me, and yo...Wow, Fantastic Blog, it’s so helpful to me, and your blog is very good, I’ve from your blog here, Keep on going, my friend; I will keep an eye on it,learned a lot. Thanks for sharing it...<br /><br /><a href="http://www.etoims.com" rel="nofollow">Deep muscle pain relief</a>Muscle Painhttps://www.blogger.com/profile/18134611108729463434noreply@blogger.comtag:blogger.com,1999:blog-2550386066385582083.post-41370152836100229552013-02-27T12:03:04.276-08:002013-02-27T12:03:04.276-08:00Again, a nice post. There are many ways to do thi...Again, a nice post. There are many ways to do this, and it is important that you get use to the syntax of one of the ways and use it as often as possible. Sometimes looking at the function can scare one off, but with a little practice they become more intuitive. Great examples, and very clear coding!Doug Lawsonhttps://www.blogger.com/profile/11454885709941990550noreply@blogger.comtag:blogger.com,1999:blog-2550386066385582083.post-84045227435713048172013-02-03T22:05:34.872-08:002013-02-03T22:05:34.872-08:00I find melt() and cast() so intuitive that I haven...I find melt() and cast() so intuitive that I haven't tried anything else. The terms "wide" and "long" also always bug me because it seems so relative. Often "wide" can get wider and "long" can get longer.a Tomhttps://www.blogger.com/profile/07509077480190944037noreply@blogger.comtag:blogger.com,1999:blog-2550386066385582083.post-36827076460468434812013-02-03T07:17:03.701-08:002013-02-03T07:17:03.701-08:00Thanks! :) I'm waiting on your guest post too!...Thanks! :) I'm waiting on your guest post too!Slawa Rokickihttps://www.blogger.com/profile/17017311098539878072noreply@blogger.comtag:blogger.com,1999:blog-2550386066385582083.post-87267352995670640342013-02-01T17:51:15.351-08:002013-02-01T17:51:15.351-08:00Best post yet! I have found reshape to be incredib...Best post yet! I have found reshape to be incredibly tricky. Every time I think I've mastered it, I try it on a new dataset and get tons of errors. (Not gonna lie, once I just gave up and did the analysis in Stata.) This is now bookmarked for next time I need to use the command.<br /><br />Can't wait for you to do a post on tapply() !!!Portiahttps://www.blogger.com/profile/00066190511506873087noreply@blogger.com