![]() Most commercial video editing programs have similar interfaces. I will outline the basic steps using two of them, one a commerical GUI based product (not free) called Camtasia, and the other a free command-based program called FFmpeg. There are many commercial, freeware, and free software programs available that we could use. Now that we have created our graphs, we need to combine them into a video. We can view the contents of the directory to verify that Stata has created a file for each of our graphs. Note that the name of each graph file includes the value of mu so that we know the order of our files. Graph export graph_`mu'.png, as(png) width(1280) height(720) replace We can do this by adding graph export inside the loop. We can fix that by reformating the means using the string() function. That’s not a mistake, it’s because Stata stores numbers and performs calculations in base two and displays them in base ten for a detailed explanation, see Precision (yet again), Part I. You may have also noticed that some of the values of the mean did not look as you would have wanted. You may have noticed the illusion of motion as Stata created each graph the normal densities appeared to be moving to the right as each new graph appeared on the screen. The loop below creates a series of graphs of normal densities with means 0 through 1 in increments of 0.1. If, for each interation, the graph command created a slightly different graph, we would be on our way to creating our first video. We could place a graph command inside the loop. If you are not familiar with loops in Stata, here’s one to count to five: To create the illusion of motion with graphs, we make an ordered series of slightly differing graphs. Our brains perceive this series of still images as motion. All videos - from Charles-Émile Reynaud’s 1877 praxinoscope to modern blu-ray movies - are created by displaying a series of ordered still images for a fraction of a second each. Creating animated graphs allowed me to skip the explanation and just show what I meant. ![]() Both of these concepts can be illustrated with a static graph along with the explanation “imagine that …”. I wanted to illustrate two concepts: (1) that statistcal power increases as sample size increases, and (2) as effect size increases. I recently recorded a video for the Stata Youtube channel called “ Power and sample size calculations in Stata: A conceptual introduction“. I will show you how I create my animated graphs using Camtasia and how Robert creates his using FFmpeg. At the 2012 UK Stata User Group Meeting Robert Grant demonstrated how to create animated graphics from within Stata using a free software program called FFmpeg. In addition to Stata, you will need a video editing program but don’t be concerned if you don’t have one. It’s easier than you might expect and you can use animated graphics to illustrate concepts that would be challenging to illustrate with static graphs. ![]() Today I want to show you how to create animated graphics using Stata.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |