and now we will learn how to change the variable names and values and view those results in a
table changing the name of a variable is very easy but there are three important things that
you must remember you must choose carefully each character for each variable meaning each letter or
each number that you're going to make part of the name the reason that you have to be very careful
is that variables in stata are case sensitive so if you put a capital letter and the actual
spelling of the variable has a lowercase letter in that position your analyses will not work you
must spell the variable name exactly when running an analysis that includes every number you put as
part of the name or every capital or lowercase letter now here we are in stata and let's open
the data sheet that we've been working with here are the variables in the columns with
the 20 observations for the 20 respondents for the results of the survey about the East Meadow
pool notice that we have the same information in the field but the variables themselves are
not named yet they only have the default name now the way to name them is to use a tool that
comes up on the right called properties if you don't see this on the right or maybe somebody
closed it what you can do is go to the main menu and click view properties because you need the
properties window in the data sheet to change the names of the variables themselves so let's
reopen it now it's very very simple click on the name of the variable that you want to change and
in the properties window where it says name you can click next to the word name and type in the
name then the question is what should we name these six variables well here's the original
Excel spreadsheet that I had copied the data from you might recognize this from our first video so
let's just make it exactly as it is here except for these last two because it's nice or these
last three it's nice if we make the variable name only one word and it might be better to
keep the variable names and lowercase so let's make the first variable name and gender click
on the variable name make sure the properties window is open and next to the word name where
it says there one highlight it and i'm going to type in gender oh that's uppercase I like to have
it lowercase gender now when I hit the enter key you can see in the data sheet the name has changed
to gender the second name is age so we click on the next variable open the properties window and
next to the word name we type h then when we hit the enter key the variable name has changed let's
do this for the other continent no problem go back to the data sheet over here properties name
continent hit enter ok then variable for let's take a look at what that is let's just put the
word visit to save time so variable for go to properties next to name you type visits then hit
enter it'll save the name variable five we can just put one word enjoyment and then of course
hit enter hope you know what I didn't have the properties window open when I did that so in joy
oops meant or however one would spell it hit enter and make sure you type every character carefully
because you will run analysis with that variable name later and over here we can just put snacks
and we'll know this is how much they spent on snacks hit enter and now we have the names of
the variables and now we can run an analysis and now we will run our first analyses by viewing the
variables in a table the table is the most basic of analysis we will show a table with only one
variable at a time first we will view discrete variables in a table so you can see how it works
now you will learn your very first command from the command line it is the most simple command
in stata to ask it for a table type T a B then the space bar then the name of the variable you
would like to run a table on how about gender when we push the enter key you can see that we
now have a table telling us the frequency of each gender according to this table there are
ten instances or appearances of the word female in the column of gender there are 10 appearances
or instances of the word male in that same variable gender now how can we check if this
is right well we can reopen the data sheet and look at gender how many males one two three four
five six seven eight nine ten so our table is accurate so now let's try running a table with
the variable continent Gav space and you must spell con chin meant exactly as it's spelled in
the column heading in the data sheet now notice according to this table there are six appearances
of the word Asia for appearances of the word Australia and so on in the data sheet for that
the one with the fewest appearances of South America according to the table there's only
two in the whole data sheet let's open the data sheet look at the column continent and how many
times the South America appear once twice that's it so the table is accurate now let's run an
analysis using a continuous variable for example the variable visits type ta be space the name of
the variable in this case visits notice a table is not perfect for a continuous variable what this
table is saying is that two people visited the pool twice a month two people visited the pool
three times a month and so on there were actually three people who visited the pool exactly ten
times a month and only one person visited it 11 times another individual visit 12 times and so on
so it's not giving you the perfect picture of how frequent people are visiting the pool but it does
show you the idea of how a table works even with a continuous variable if you want to check if it's
accurate you can see the number three is next to the number ten that means that three people
visited the pool ten times during the month and if we open the data sheet we can see that with visits
how many times to ten appear 12 well let's start again here they are 1 2 3 3 times the number 10
appeared three times so that's how a table would work with a continuous variable it would be even
worse with snacks if we ran a table for snacks you can see that almost everyone spent a different
amount except for these two people who spend zero oh these two people who spent exactly 15 and these
two people who spend 18 so that's why a table is not a perfect analyses for a continuous variable
will learn more about the other types of analyses that are better for viewing continuous variables