chapter 1sci.tamucc.edu/~jguardiola/math 1442/jmp labs/lab manuals math 1442...chapter 1 page 1...
TRANSCRIPT
Chapter 1 Page 1
CHAPTER 1
Class Activities
Discussion of the syllabus.
You instructor will help you to organize all of you in teams, please form teams from 3 to 5 team
members. Working collaboratively is an important ability that will pay off in your professional
life. Please choose an appropriate name that uniquely identifies your team.
All homework assignments should be done collaboratively. Please try to contribute to the team
effort as much as possible and remember that your team members are going to evaluate your
work by the end of this course. This evaluation will be part of your lab grade.
Homework assignments are due in one week after it was assigned, unless otherwise specified by
your lab instructor. Homework should be done using the specified format (usually a word
document following the APA style). The names of all members of your team should be listed in
the original document submitted (no late additions will be accepted).
All reports and summaries should be written from the point of view of a consultant hired to
perform the statistical analysis or reports.
Follow the activities described in this document.
Opening and Saving Files
JMP can open Excel and JMP files, you can practice opening files as follows:
Example: Open JMP file MHEALTH, select Open data Table, then click on the directory where the file is
located and then select the file that you want to open:
Chapter 1 Page 3
Make sure that you marked the box “Select Individual Worksheets” if you have multiple worksheets and
also select “Use Excel Label as Headings”, just verify that you have a suitable file with column headings.
The Excel files must be compatible with Excel version 1997-2003. Unfortunately, JMP is not reading
newer versions of Excel. If the file that you are trying to open is in a newer version of Excel, you have to
open this file from Excel and save it again as a file compatible with the Excel version 1997-2003.
Saving files:
Exercise: Practice saving file MHEALTH under a new name, MEHALTH1 using the option “Save as” from
the file menu, as shown below:
Figure 3.
Change the name to MHEALTH to MHEALTH1 as shown below:
Chapter 1 Page 4
Figure 4.
finally, click over “save” and you are done.
Individual Class Exercises:
1- Open the JMP File FHEALTH and save as a JMP file using another name. Also, you can save it as
an Excel compatible file, using the option File->Export and click over the option Excel. Practice
doing that and then open the file from Excel.
2- Open the Excel file Coin.xls and select sheet1, then take a look at the variables, change the name
and save it as a JMP file.
Please ask your lab assistant if you have any problems.
Types of Data
As you studied during lecture and in your textbook, there are different types of data and
measurement levels. In most statistical packages we need to define which type of data we want to
use for every variable. That is done mainly for two reasons: first, the computer allocates memory
resources more efficiently, and second, it helps you to determine the type of analysis suitable for a
certain type of data. JMP helps you to narrow the choices for the type of analysis that you need to
perform. According to the type of data that you previously defined, there are certain types of
analysis that are not suitable and therefore they will become unavailable in JMP. You may change
the type of data, if appropriate, in order to make available a certain type of analysis.
Chapter 1 Page 5
Table 1.
Textbook Textbook
JMP Type of Data Level of measurement
Numeric – Continuous Quantitative-Continuous Ratio or Interval
Numeric – Ordinal Quantitative-Discrete Ordinal
Numeric – Nominal Categorical Nominal
Character – Ordinal Categorical Nominal
Character – Nominal Categorical Nominal
Let’s open the JMP file CHMOVIE. To edit or determine the type of data for one column in the
dataset you have to right-click the heading of the column, then click over “column info”
Figure 5.
A new window will open where you can change the type of data, the modeling type, and the column
properties (formula….etc.)
Chapter 1 Page 6
Figure 6.
Please be aware that there are certain types of analyses available for certain types of data. JMP
automatically recognizes the types of analysis that can be performed. You can use Table 1 shown above
to determine the type of data.
Class Example: With the help of your lab instructor, open the file CHMOVIE and change the type of data
on Length, Tobacco Use, and Alcohol Use, to character type. Please be aware that once that you change
numbers to a character type, these data cannot longer be used for numeric computations. You can also
change the column labeled “Company” that has been defined as a character, to numeric, however the
data will disappear, as there are no equivalence between these types of data. Numeric data can be
changed to characters, just notice that the alignment on the cell changes (left aligned), but the data is
preserved. Finally, change again the type of data to match the original definition. Unfortunately, the
characters that were changed to numbers can’t be recovered. Of course, you can always exit without
saving your work to avoid keeping changes in your file.
Random Samples
You already studied during lecture and from your textbook some methods of sampling. At this point you
should be aware of the importance of obtaining a random sample. We can’t overemphasize the
importance of obtaining a random sample in inferential statistics. Fortunately, JMP has some tools that
allow you to select a random sample from a dataset without spending a lot of effort.
Chapter 1 Page 7
Class Example: Open the file BEARS, and obtain a random sample of 10 bears following the procedure
outlined below:
1- Then go to the menu “Tables” and select “subset” as shown below:
Figure 7.
2- Then a new window will open, select “Random- sample size” and indicate 10 as the sample size
that you want. Then click OK.
Chapter 1 Page 8
Figure 8.
3- A new window will open with a new dataset entitled “Subset of BEARS”. This new file contains a
random sample of 10 elements taken from the original file.
Chapter 1 Page 9
Figure 9.
4- However, we can observe that the number of male bears, is much larger than the number of
female bears (results may vary, after all this is a random sample), in some cases, we would like a
more balanced number of bears according to gender. As you study before during lecture time, there
are some sampling techniques such as stratified sampling that allow you to obtain a certain number
of samples from each strata. This can be accomplished by clicking the box “stratified” and selecting
the variable “SEX” in order to obtain a stratified sample of size 10 from each gender. Results are as
follows:
Chapter 1 Page 10
4- Then a new sample size ten is obtained from each strata as can be shown below:
Figure 10.
Chapter 1 Page 11
The data above is shown after using the menu “Tables” and “Sort”, and selecting “Sex” as the variable to
be ordered.
Individual Class Activity:
- Open a file of your preference and do the following:
o Obtain a random sample of any size of your preference
o If there is a categorical variable in your dataset, use it as a classification variable to
obtained a stratified sample with the same number of elements per strata. Be careful to
specify a sample size that is less than the minimum number of elements available for
each strata.
Team Class Activity:
At this point you should be already organized on teams, if you are not yet a member of a team, please
talk to your lab instructor.
Team Assignment:
1- Open the Excel file “Smalltown_TX.xls” located on the data sets folder in Blackboard.
Determine the type of data that should be used for each variable listed in this file. Check the
type of data and change it if needed.
2- Obtain a random sample of size 70 to 100 observations and save it and keep it in a safe place.
This dataset will be used frequently in many assignments during this course. Please keep this file
accessible for you and all your team members during the rest of the course. Discuss why a
stratified sample for men and women should or should not be used.
3- List the name of each variable and its corresponding type of data in a table. Classify each
variable as Quantitative or Qualitative, and then for Quantitative variables, classify them again
as discrete or continuous. Also, classify each variable according to their level of measurement.
Show your findings in a table. Make sure that your JMP file contains the correct type of data for
each variable. Discuss if the sample that you obtained is representative of the whole population
(there are 1,000 observations).
4- Write a report for your lab instructor in a word document summarizing your activities for all
previous steps.
Chapter Summary
You already practiced the following topics during this chapter:
Opening an closing files on JMP
Defining and changing types of data on JMP
Obtaining a random sample or a stratified random sample from a dataset.