J Lab 1
Introduction to Jamovi
This lab is based on the R lab from Chapter 3 of the Introduction to Modern Statistics (2e) textbook by Mine Çetinkaya-Rundel and Johanna Hardin.
Jamovi
For this lab you will need to download and install the Jamovi software on your computer. You can download it here. Jamovi is a free and open-source statistical software that is similar to SPSS.
Once you have installed Jamovi, open the software and you will see a spreadsheet interface that looks like Figure 1. There is an icon in the top left corner that looks like three horizontal lines. We will call this the hamburger menu, because it looks a little like a hamburger.
Data
You can enter data manually into the Jamovi spreadsheet, or you can import data from a file. For the first part of this lab, we will use the data in the file arbuthnot.csv. You can download the file here or from our course Moodle page.
Download the arbuthnot.csv file to your computer (it will probably be saved to your Downloads folder). Then, in Jamovi, click on the hamburger menu and select Open to open the file. Click on the Browse button that appears on the top right. Navigate to the arbuthnot.csv file and click Open. The data will be loaded into the Jamovi spreadsheet. The data should look like Figure 2.
arbuthnot data loaded into the Jamovi spreadsheet.
The data are organized as a data frame with 82 rows and 3 columns. The columns are: year, boys, and girls. Each row represents an observational unit, each column represents a variable. There are also row numbers on the left side of the spreadsheet that are not part of the data frame.
When you open a data file in Jamovi, the software will automatically try to guess the type of data in each column. However, you should always check to make sure that Jamovi assigns the data types correctly. If you are entering your data manually into the spreadsheet instead of importing it from a file, you will also need to manually specify the data type for each column.
To change the data type of a column, click on the Data tab (to the right of the hamburger). Then click on the Setup icon. You can select different columns by clicking on the column names at the top of the spreadsheet. Figure 3 shows what it looks like when you specify the data type of the year column.
year variable.
Each data variable has a Measure type and a Data type that can be specified using drop-down menus. The Measure type can be Nominal, Ordinal, Continuous, or ID. Since year is a numeric variable, specify the Measure type as Continuous. Next, specify the Data type as Integer. It is likely that Jamovi already guessed the correct data type for the year column, so you may not need to make any changes.
The variables boys and girls are also numeric variables with integer values, so ensure that their data types are specified similarly to the year column.
Note that you can also change the name of each variable and add a description of the variable using the same menu. Finally, if you are working with a categorical variable, you can specify the order of the levels of the variable using the Levels interface. We will not need to do this for now, because all three variables are numeric.
Once you are done specifying the data types, click on the Setup icon again to return to the spreadsheet.
Data visualization
The arbuthnot data set contains data on the number of baptisms in London from 1629 to 1710. The year column contains the year of the observation, and the boys and girls columns contain the numbers of boys and girls baptized. The data were collected by John Arbuthnot, a physician and mathematician living at the time.
We can use Jamovi to plot the data to visualize the trends in the number of baptisms over time. To create a plot, click on the Analyses tab (to the right of the hamburger). Then click on the Exploration icon and select Scatter plot. The scatter plot interface will appear, as shown in Figure 4.
You can drag and drop the variables you want to plot into the X-Axis and Y-Axis boxes. Drag the year variable into the X-Axis box and the girls variable into the Y-Axis box. You should see a scatter plot of the number of girls over time, as shown in Figure 5.
Is there a tend in the number of girls baptized over time? How would you visualize the number of boys baptized over time?
Creating new variables
Suppose we wanted to plot the total number of baptisms over time rather than then number of girls or boys separately. We can create a new variable in the data frame that is the sum of the boys and girls variables. To do this, click on the Data tab. Next click on the title of the girls column so the new variable is added to the right of the girls column. Then click on the Compute icon. Change the name of the computed variable to total and enter = boys + girls in the formula box, as shown in Figure 6. Jamovi will automatically compute the sum of the boys and girls variables for each row and add the results to a new column called total. The new column is also visible in Figure 6.
total baptisms colum to the data frame.
Now we can create a scatter plot of the total number of baptisms over time. Try to do this yourself. Your results should look like the scatter plot in Figure 7.
Numerical summaries
We can also calculate numerical summaries of the data. For example, we can calculate the minimum and maximum numbers of total baptisms in the data. To do this, click on the Analyses tab and then click on the Exploration icon. Select Descriptives.
Since we want to summarize the total variable, drag the total variable into the Variables box. Then, expand the Statistics options menu by clicking on its header. Then you can check the boxes for the descriptive statistics you want to calculate. Select Minimum and Maximum. Your results should look like Figure 8. Note that a table of values is added to the right panel in Jamovi.
Copying tables and plots from Jamovi to include in your lab report
You can copy tables and plots from Jamovi to include in reports. To copy a table or plot, right-click on the table or plot and select Copy. (If you are using a Mac without right-clicking turned on, hold control and then click instead of right-clicking). You can then paste the table or plot into your report.
Saving your work
You can save your work in Jamovi by clicking on the hamburger menu and selecting Save. You can save your work as a .omv file, which is a file that can be opened in Jamovi. However, you will not turn this file in for your lab report. Instead, you will turn in a PDF of your lab report that includes screenshots of the Jamovi interface, scatter plots, tables, and your answers to questions at the end of the lab. Even though you are not turning it in, you should save your Jamovi file in case you need to refer back to it later.
What you need to turn in
Download the present.csv data file from the course Moodle page or using this link. This data set includes modern birth records for the United States. Make sure the data types are correct for all of the variables in the data set.
Open the file in Jamovi and answer the following questions:
- Take a screenshot of the Jamovi interface that shows the
presentdata set loaded into the spreadsheet. Include the screenshot in your lab report. You can take a screenshot of a portion of the screen on a Mac by pressing the command + shift + 4 keys at the same time. Then you can drag the cursor to select the area you want to capture. The screenshot will be saved to your desktop. On a Windows computer, you can press the Windows + Shift + S keys at the same time to take a screenshot of the entire screen. The screenshot will be saved to your Pictures folder. - Scroll through the spreadsheet in Jamovi. What years are included in the
presentdata? How many observations are there in the data set? What are the variable names? - Compare the counts to the total baptisms in the
arbuthnotdata. Are they similar in magnitude? - Create a scatter plot of the number of boys over time. What trends do you see in the data? Include your scatter plot in your lab report.
- Add a new variable called
prop_boysto the data frame that lists the proportion of boys born each year. You can calculate this proportion by dividing the number of boys by the total number of births. You can do this in two steps by first creating a new variable,total, that is the sum of theboysandgirlsvariables, and then creating a new variable that is the ratio of theboysvariable to the newtotalvariable. Take a screenshot of the Jamovi interface that shows the spreadsheet with the new variable added. Include the screenshot in your lab report. - Create a scatter plot of the proportion of boys born over time. What trends do you see in the data? Include your scatter plot in your lab report.
- Calculate the minimum and maximum proportions of boys born in the
presentdata. Include the table of values in your lab report. Based on these values, were there any years in which there were more girls born than boys?
You may create your lab report in a Word document or a Google Doc. You may organize your report as numbered answers to the questions listed above. Include the screenshots and scatter plots and table in your report, making sure that they are positioned under the correct question number. You should also include your answers to the questions in your report, and your answers should refer to the relevant scatter plot or table when applicable. Save your report as a PDF and submit it to the course Moodle page (check the pdf before you submit it to make sure it is readable and complete).