CS midterm
Suppose a MATLAB variable x = [ -2 3 1; 0 4 -1] Which of the below is the results of sum(x, 2) ?
2 3
Suppose a MATLAB variable x = [ -2 3 1; 0 4 -1] Which of the below is the tabular form of x ?
-2 3 1 0 4 -1
Suppose a MATLAB variable x = [ -2 3 1; 0 4 -1] Which of the below is the results of reshape(x, 3, 2) ?
-2 4 0 1 3 -1
Within MATLAB, Logical Vector arrays are based on applying a condition to an existing array.
0
The pie chart above shows a breakdown by different causes for deaths in the US in 2002. What fraction of the deaths were due to stroke or respiratory causes?
0.15
The pie chart above shows a breakdown by different causes for deaths in the US in 2002. Approximately how many deaths occurred from cancer?
0.48 million
Suppose the MATLAB variable exampleArray is defined by: exampleteArray = [ 4, 6, 10; 11, 7, 6; 0, -1, -4]; Click on the array that shows the results of the MATLAB command: x = max(exampleArray(:))
11
Suppose a MATLAB variable A is defined by: A = [ 10, 15, 6, 4; 11, 4, 7, 3; 5, -1, -3, 12 ] To access the individual elements of an array, you give MATLAB indices in parentheses. What is the value of the new variable B given the below script? B = A(3, 1)
5
Suppose a MATLAB variable x = [ -2 3 1; 0 4 -1] Which of the below is the results of diff(x, 1, 2) ?
5 -2 4 -5
Suppose x is a MATLAB variable x = [ -2, 3, 1; 0, 4, -1] Find y = diff(x,1, 2)
5 -2 4 -5
On the box plot above, what is the median Wake Time of Section 3?
9:00am
In MATLAB a collection of data values (for example, numbers or text values) with both rows and columns (2 dimensional) is called ?
Array
In MATLAB a function is a group of statements that perform a task. Functions can accept more than one input argument and may return more than one output argument. Below is script syntax using the SUM function. B = sum(A. 1) Which is the variable which holds the resulting sum (addition)?
B
In MATLAB the position in an array or vector are called?
Indices
Error bars are a visual device that is generally used to convey uncertainty.
True
In hypothesis testing, the MATLAB function "ttest2" compares the means of two data sets to see if the means are similar within a specific statistical significance.
True
Mercury (Hg) poisoning is a serious problem among children, and amalgam dental fillings are thought to be one source of mercury. The chart above shows the average amount of mercury in urine for a group of children who were randomly assigned to receive amalgam fillings (black dots) and composite fillings (white dots) [Woods et al. EHP 115(10), 2007]. The error bars show the 95% confidence intervals. Approximately what was the 95% confidence interval for amalgam fillings in follow-up year 2?
[2.5, 3.3]
Suppose x = [ 1, 2, 3, 4; 5, 6, 7, 8] and y = x(2, 3:4). What is y?
[7, 8]
A MATLAB variable called count holds a table of size 50 x 4. What is the size of sum(count, 1)?
a single row with 4 elements
What is the best estimate of the inter quartile range for the petal widths of theIris versicolor specimens?
about 0.5 mm
The graph above shows the average BMI among a group of American Indian and Alaska native adult diabetes patients. The body mass index (BMI) is the ratio of an individual's weight to the square of the individual's height. A BMI of 18 to 25 is an indicator of normal weight. By how much did the average BMI increase for the youngest group of patients over the decade 1995 to 2004?
about 3 units
In MATLAB, a For Loop Statement is used to repeat select code statements based on a specified number/condition. In the above code, the value of x is changed each time the loop is executed. What type of loop is this?
an accumulation loop
The following table gives the counts of bacteria at two different beaches. The shaded portion of the table corresponds to the MATLAB variable called beaches. Which of the below scripts defines the variable beach1 that contains the bacterial count for beach 1.
beach1 = beaches( : , 2);
The following table gives the counts of bacteria at two different beaches. The shaded portion of the table corresponds to the MATLAB variable called beaches. Given we define the following variables in our MATLAB script beach1 = beaches(:,2); beach2 = beaches(:,3); bothBeaches = beaches(:, [2,3]); beach1Total = sum(beach1); beachesTotal = sum(bothBeaches(:)); day5Total = sum(bothBeaches(2,:)); Which of the scripts below define a variable that holds the percentage of Day 5's count occurring on Beach 1?
day5Beach1Percent = 100.*beach1(2)./day5Total;
In hypothesis testing, the significance value is a numeric value you can set for your test. It allows you to...
determine how much you should trust your conclusion...how reliable is my decision.
The first step to take to analyze your data is to gather the mean and median to determine central tendency of your data set. The second step is to....
determine your data's measures of spread.
In MATLAB we use several different functions to perform statistical computations. Which MATLAB Function returns the largest value in the array (depending on the number of rows/columns and which dimension is provided)?
max function
In Nature Data Distributions can take on many forms. Below is one example of a typical distribution. What type of distribution does the above graph display?
normal
A lab gradebook for a class of 50 students is contained in a 50 × 4 array called 'grades' for the four labs in the course. In addition to the gradebook, the instructor keeps a gender array of size 50 × 1 containing the genders ('male', or 'female') of the students in the class. Define a variable to find the overall class average on all of the labs for the course.
overallAverage = mean(grades(:));
The purpose of the two-sample t-test (MATLAB's ttest2) is:
to determine whether the means of two populations are likely to be different based on the values of the two samples
On a boxplot, what does the position of the plus signs mean?
values outside 1.5*IQR (it is an outlier)
The following table gives the counts of bacteria at two different beaches. The shaded portion of the table corresponds to the MATLAB variable called beaches. Which of the below scripts defines the variable day5 that contains the bacterial count for both beaches on day 5?
day5 = beaches( 2, [ 2, 3])
The following scatterplot shows the relationship between mean parent beak sizes and mean child beak sizes. The best linear fit (linear model) is displayed on the graph. An additional data point is added to the data set having a mean parent beak size of 10.75 and a child beak size of 10. Draw this point on the graph.
*picture is answer*
Suppose wakeHour is a 21 × 144 array containing wake up hour of each student in a 144-student cohort for sleep diaries recorded over a 21-day period. Similarly, bedHour is a 21×144 array containing the bed hour for the same students. Both the wakeHour and bedHour are given in 24-hour format relative to midnight on the wakeup day. Suppose the best fit linear model for the student averages is wakeHour = 0.7*bedHour + 8.5. If a student goes to bed at 11 pm and gets up at 9 am on average, what is the error in the model prediction?
-0.7 + 8.5 = 7.8 is predicted: error is 9 - 7.8 = 1.2
Which of the below statements about Hypothesis Testing is FALSE?
-It uses a full data set instead of a sample. -The goal of Hypothesis Testing is to make an "informed decision". -Associated with hypothesis testing is a quantitative evaluation of "how reliable" (statistically significant). How much we should trust the conclusion. -Uses statistical evident to prove or disprove the hypothesis. (not a hunch)
Many times the relationship between data sets is not perfect, but move along a spectrum. We use Linear models in our analysis of these data sets. Which of the below statements is NOT true about linear models
-Linear Models allows us to make predictions about data potentially not available in the original data sets -They are used to generate best fit lines -MATLAB does not allow you to generate linear models -They are used throughout the scientific, mathematical and engineering communities
Which of the below statements about Box Plots is False?
-Requires each data set to be the exact same size. -Also called Tukey box plots -Can be either displayed vertical or horizontal -They allow you to compare data sets of varying size -Also called 'whisker plot' or 'box and whisker'
Which of the below statements about Logical Arrays in MATLAB is false?
-They can be used to extract rows and/or columns for subgroups. -They can be based on numeric or non-numeric data. -They end up one column/row less than the original. -They can be used to make comparisons.
The following scatterplot shows the relationship between mean parent beak sizes and mean child beak sizes. The best linear fit (linear model) is displayed on the graph. An additional data point is added to the data set having a mean child beak size of 8 parent beak size of 9.3. what is the error between this new measurement and its predicted value?
.96
In MATLAB a function is a group of statements that perform a task. Functions can accept more than one input argument and may return more than one output argument. Below is script syntax using the SUM function. B = sum(A, 1) What is the default dimension to sum over?
1
Within MATLAB, Logical Vector arrays are based on applying a condition to an existing array. When the condition is true, what is the corresponding element placed in the logical array?
1
The graph above shows the number of cricket chirps per second measured at different environmental temperatures. The red line is a linear model calculated by fitting the best straight line to the data. Approximately how many chirps/second correspond to 60oF for the linear model?
1.5
The above table shows the number of cases (in thousands) of measles and mumps in New York City for the years 1940 to 1944. What fraction of the cases in 1943 were measles?
1/3
In MATLAB several functions default to along the first non-singleton dimension, if you do not provide a dimension argument. This means that if the array provided is: a vector of single row of values a vector of a single column of values MATLAB will perform the computation across that single vector (if no dimension argument is provided). However, if your variable is an array with multiple rows or columns, and you do NOT include a dimension argument, MATLAB will default to dimension 1 (transversing the computations down the rows). Given the MATLAB Variable: C = [ 6, 8, 10 ]
10
In MATLAB, a For Loop Statement is used to repeat select code statements based on a specified number/condition. In the above code, the value of x is changed each time the loop is executed. What is the value of x after the second pass?
10
The plot above compares the distributions of plant heights for control and treated groups, respectively. What is the median height of the control group in cm?
10
When creating a Histogram in MATLAB, the default number of bins is:
10
In MATLAB several functions default to along the first non-singleton dimension, if you do not provide a dimension argument. This means that if the array provided is: a vector of single row of values a vector of a single column of values MATLAB will perform the computation across that single vector (if no dimension argument is provided). However, if your variable is an array with multiple rows or columns, and you do NOT include a dimension argument, MATLAB will default to dimension 1 (transversing the computations down the rows). Given the MATLAB Variable: C = [ 6, 8, 10 ; 12, 4, 11] Which answer below provides the value of E if: E = max(C, [ ] , 2).
10 12
What is the formula for calculating percentages?
100 * (portion of population / total of population)
Tickets is a table with 30 rows and 5 columns representing the number of tickets sold for each of 30 days at 5 different ticket locations. Which of the following calculates the percentage of the tickets that were sold at location 1.
100.*sum(Tickets(:, 1))./sum(Tickets(:))
What is the value of x after the following MATLAB code executes? x = 5; for k = 1:3 x = x + k; end;
11
The following boxplot shows the average hours slept of 24 high school students during a recent semester of class. What was the maximum number of hours slept on Friday?
12
This question is about question from a recent highly-accessed article from PLosOne in which Gillen et al. show that three minutes of all-out-exercise/per week has the effect of increasing health status. The following is Table 1 excerpted from that paper. The information you need to answer the question is presented here. Values are means +/- SD. N = 7 for men and women. V02peak = maximal oxygen update. * means significantly different from men (p < 0.05) How many subjects were involved in this study?
14
Copy of In MATLAB, a For Loop Statement is used to repeat select code statements based on a specified number/condition. In the above code, the value of x is changed each time the loop is executed. What is the value of x after the third pass?
19
In MATLAB, a For Loop Statement is used to repeat select code statements based on a specified number/condition. In the above code, what is the value of x after the code is completed?
19
In MATLAB, you can use your For Loop Condition variables within your execution code. In the above code, k is the condition variable and x is an array with existing elements. What is the starting value of k?
2
Suppose x is a MATLAB variable x = [ -2, 3, 1; 0, 4, -1] Find y = diff(x,1, 1)
2 1 -2
Approximately what is the median petal width of the Iris versicolor specimens in the Fisher iris data?
2.0 mm
On a boxplot, what does the position of the bottom of the box represent?
25% value in the data set
The graph above shows the total number of cases of 3 different childhood diseases in New York City (NYC) for the years 1931-1971. What was the maximum total number of cases for any month?
250,000
In MATLAB, a For Loop Statement is used to repeat select code statements based on a specified number/condition. In the above code, how many times will the selected code be repeated?
3
Trace the following loop. What is the value of k when the loop completes?
3
In MATLAB, IF statements are use to process specific/select code based on conditions. Based on the above code, what is the value of "y" after the script is completed??
32
The side-by-side (left) and stacked (right) bar graphs below show the same information. The data is from lesson 1 (count.dat) and tracks vehicles thru 3 specific intersections. The graphs below are a sub set of the overall data and display the data from 9am to 5pm. What percent of vehicle traffic was thru IH10 at 5pm?
32%
In MATLAB, when you create a graph to track Rates of Change, you can use a plotyy function which puts different scales on the y axis. Based on the data in the graph above, when is the peak fetal growth rate?
35
The graph above shows the average BMI among a group of American Indian and Alaska native adult diabetes patients. The body mass index (BMI) is the ratio of an individual's weight to the square of the individual's height. A BMI of 18 to 25 is an indicator of normal weight. What was the average BMI among patients in the 18-39 year old group in 2004?
37
In MATLAB, you can use your For Loop Condition variables within your execution code. In the above code, k is the condition variable and x is an array with existing elements? The execution statement uses k as array index (which position in the array). What are the values of k after the code is executed?
4
In MATLAB IF statements allow you to use logical operators in the conditions. Which of the below conditions statements would NOT work?
400 <= total21 & total21 <= 1000
In MATLAB, a For Loop Statement is used to repeat select code statements based on a specified number/condition. In the above code, the value of x is changed each time the loop is executed. What is the value of x after the first pass?
6
The following boxplot shows the average hours slept of 24 high school students during a recent semester of class. How many students got more than 8 hours of sleep on Monday?
6
The following boxplot shows the average hours slept of 24 high school students during a recent semester of class. What was the medium number of hours slept on Tuesday?
7
Suppose a MATLAB variable A is defined by: A = [ 10, 15, 6, 4; 11, 4, 7, 3; 5, -1, -3, 12 ] Click on the array that shows the results found in array B after you run the below script. B = sum(A(:))
73
Given the above Histogram, approximately how many birds had beak sizes of 11 mm?
75
On a boxplot, what does the position of the top of the box represent?
75% value in the data set
On the boxplot above, what is the Wake Time at the 25 percentile of Section 1?
7:30am
In MATLAB, when you create a graph to track Rates of Change, you can use a plotyy function which puts different scales on the y axis. Based on the data in the graph above, what is the approximate fetal weight at week 40?
8 lbs
The side-by-side (left) and stacked (right) bar graphs below show the same information. The data is from lesson 1 (count.dat) and tracks vehicles thru 3 specific intersections. The graphs below are a sub set of the overall data and display the data from 9am to 5pm. How many more vehicles traveled thru the LP410 intersection at 9am than Durango?
80
Suppose wakeHour is a 21 × 144 array containing wake up hour of each student in a 144-student cohort for sleep diaries recorded over a 21-day period. Similarly, bedHour is a 21×144 array containing the bed hour for the same students. Both the wakeHour and bedHour are given in 24-hour format relative to midnight on the wakeup day. Suppose the best fit linear model for the student averages is wakeHour = 0.7*bedHour + 8.5. If someone goes to bed at midnight on average, what time does the model predict that he or she wakes up?
8:30am
The following scatterplot shows the relationship between mean parent beak sizes and mean child beak sizes. What is the average beak size of a child if the parents beak size is 10.5. You can use the best fit line to help make your calculation
9.89
This question is about question from a recent highly-accessed article from PLosOne in which Gillen et al. show that three minutes of all-out-exercise/per week has the effect of increasing health status. Table 1 and Figure 2 are excerpted from that paper. The information you need to answer the question is presented here. Values are means +/- SD. N = 7 for men and women. V02peak = maximal oxygen update. * means significantly different from men (p < 0.05). FIGURE: Characterization of the low-volume SIT protocol. Solid line represents average heart rate (HR) response expressed as a % of maximum for all subjects during the first training session. Bar graph represents relative mean power output (MPO) per kilogram fat free mass (FFM). (Original figure is doi:10.1371/journal.pone.0111489.g00.) What is the average relative heart rate two minutes into the experiment?
90%
In MATLAB a function is a group of statements that perform a task. Functions can accept more than one input argument and may return more than one output argument. Below is script syntax using the SUM function. B = sum(A, 1) Which is the variable which holds the array to be sum?
A
What is the definition of a histogram?
A graphical display of a frequency table, usually using bars to present counts.
Correlation is?
A measure of the statistical relationship between two different data sets
What is a scatter plot?
A plot that graphs two variable against each other without displaying the connecting lines. The plot reveals relationships between variables.
What is the definition of a Frequency Table?
A table with counts of the number of times each unique value appears in a dataset.
The following graph is a plotyy graph - in that there are two different y axis with the same x axis - the blue line on the graph works with the y axis in blue, and the orange line with the orange y axis. This graph is the monthly averages of measles from NYCDiseases, and the differences, by month. What months had the largest change from the previous (positive or negative)?
April to June
Suppose a MATLAB variable A is defined by: A = [ 10, 15, 6, 4; 11, 4, 7, 3; 5, -1, -3, 12 ] To access the individual elements of an array, you give MATLAB indices in parentheses. Suppose you define a new variable C with the below script, C = A( : , 1) What are the elements in C?
C = [ 10; 11; 5 ]
What are the four layers of the Data Analysis Triangle, from bottom to top?
Data, Information, Knowledge, Wisdom
Hypothesis Testing Analysis: (CI Value) Suppose that the ttest2 code in MATLAB provided the following results -- h = 1, p = 0.008, and ci = [82.75. 83.40]. Which of the below answers best describes the results of the test?
For c (confidence interval) - 95% of the difference in means will between 82.75 and 83.40.
Hypothesis Testing Analysis: (CI Value) Suppose that the ttest2 code in MATLAB provided the following results -- h = 0, p = 0.565, and ci = [84.61. 85.21]. Which of the below answers best describes the results of the test?
For c (confidence interval) - 95% of the difference in means will between 84.61 and 85.21.
Hypothesis Testing Analysis: (P Value) Suppose that the ttest2 code in MATLAB provided the following results - h = 1, p = 0.008, and ci = [82.75, 83.40]. Which of the below answers best describes the results of the test?
For p value - we have a .8% chance of being wrong if we pick the alternative hypothesis. p of .008 is less than default .05 (5%) - we pick the alternative hypothesis
Hypothesis Testing Analysis: (P Value) Suppose that the ttest2 code in MATLAB provided the following results - h = 0, p = 0..565, and ci = [84.61, 85.21]. Which of the below answers best describes the results of the test?
For p value - we have a 56% chance of being wrong if we pick the alternative hypothesis
Which MATLAB graph uses buckets (bins) to group items for display?
Histograms
In hypothesis testing, MATLAB provides a P-Value. Which of the following is incorrect?
Is always set to 5% or .05.
In a MATLAB fprintf function what does the \n represent?
It causes the output to start on a new line.
On a boxplot, what does the position of the top whisker represent?
Max value in the data set (within 1.5*IQR)
The following graph is a plotyy graph - in that there are two different y axis with the same x axis - the blue line on the graph works with the y axis in blue, and the orange line with the orange y axis. This graph is the monthly averages of measles from NYCDiseases, and the differences, by month. What month had the highest average count of measles?
May
Because data is not perfect and doesn't meet the "Best Fit" line, there is a gap between data and predictions. Understanding the size of these gaps can tell you how confident (Level of Confidence) you can be in using the best fit line to make predictions. Large gaps indicate poor predictions. Small gaps indicate good predictions. Which are the two tools we use in MATLAB to measure the error values between data and the best fit line?
Mean Square Error (MSE) and Root Mean Square Error (RMS)
On a boxplot, what does the position of the red line (in the middle of the box) represent?
Median
The boxplot above has notches on it. What do the notches mean?
Middle 5% of the data set.
On a boxplot, what does the position of the bottom of the whisker represent?
Min value in the data set (within 1.5*IQR)
The side-by-side (left) and stacked (right) bar graphs below show the same information. The data is from lesson 1 (count.dat) and tracks vehicles thru 3 specific intersections. The graphs below are a sub set of the overall data and display the data from 9am to 5pm. Which intersection had the most traffic between 9am and 5pm overall? Which intersection had the least amount of vehicles thru the intersection overall?
Most: LP410 Least: Durange
Correlations will always be a number between -1 and 1, Never higher or lower. The degree two data sets are correlated will be along the spectrum from -1 to 1. When the number is near -1 it is considered to be?
Negatively correlated - inverse relationship
The following graph is a plotyy graph - in that there are two different y axis with the same x axis - the blue line on the graph works with the y axis in blue, and the orange line with the orange y axis. This graph is the monthly averages of measles from NYCDiseases, and the differences, by month. What month had the smallest change from the previous (positive or negative)?
Oct to Nov
The If function allows you to:
Process select code based on conditions.
Relative to the data triangle, information is:
Putting context to Data
The Loop function allows you to:
Repeat select code based on conditions.
What is the Null hypothesis for the below ttest2? [ h, p,ci] = ttest2(S1, S2); Where S1 is a vector containing the average final grade of each of the students in Section 1. And S2 is a vector containing the average final grade of each of the students in Section 2.
Section 1 and Section 2 average final grades are similar at a 5% significance level.
In Hypothesis testing, we perform 5 steps. Which of the answer has the correct steps and in the correct order.
State the null hypothesis, State the alternative hypothesis, set the significance level, evaluate the test statistically, make a decision
Suppose wakeHour is a 21 × 144 array containing wake up hour of each student in a 144-student cohort for sleep diaries recorded over a 21-day period. Similarly, bedHour is a 21×144 array containing the bed hour for the same students. Both the wakeHour and bedHour are given in 24-hour format relative to midnight on the wakeup day. Suppose the best fit linear model for the student averages is wakeHour = 0.7*bedHour + 8.5. If the correlation between bed hour and wake hour is 0.92, how would your characterize the correlation?
Strong Positive
What is the Null hypothesis for the below ttest? [ h, p,ci] = ttest(S1, 70); Where S1 is a vector containing the average final grade of each of the students in Section 1.
The mean final grade of section 1 students is 70 with a significance level of 5%.
What is the Alternative hypothesis for the below ttest? [ h, p,ci] = ttest(S1, 85); Where S1 is a vector containing the average midterm exam grades for Section 1.
The mean midterm grade for section 1 students was not 85 at a 5% significance level.
What is the Alternative hypothesis for the below ttest2? [ h, p,ci] = ttest2(S3, S4); Where S3 is a vector containing the average midterm exam grades for Section 3. S4 is the average midterm exam grades for Section 4.
The mean midterm grades of Section 3 and 4 are not similar.
This question is about question from a recent highly-accessed article from PLosOne in which Gillen et al. show that three minutes of all-out-exercise/per week has the effect of increasing health status. The following is Table 1 excerpted from that paper. The information you need to answer the question is presented here. Values are means +/- SD. N = 7 for men and women. V02peak = maximal oxygen update. * means significantly different from men (p < 0.05). Which one of the following statements is true about the group of selected subjects?
The men in the study had a significantly higher maximal oxygen update than the women..
What does the transpose operation ( ' ) do?
The operation flips an array on its main diagonal, making rows into columns and columns into rows.
In MATLAB a function is a group of statements that perform a task. Functions can accept more than one input argument and may return more than one output argument. Below is script syntax using the SUM function. B = sum(A) If the array A is a single row or column of numbers, what will this script provide?
The results will be just one number (value).
The side-by-side (left) and stacked (right) bar graphs below show the same information. The data is from lesson 1 (count.dat) and tracks vehicles thru 3 specific intersections. The graphs below are a sub set of the overall data and display the data from 9am to 5pm. For the stacked graph, what does each bar in the graph represent?
The total height of each bar corresponds to the total number of cars that passed thru all the intersections together, by hour.
Mercury (Hg) poisoning is a serious problem among children, and amalgam dental fillings are thought to be one source of mercury. The chart above shows the average amount of mercury in urine for a group of children who were randomly assigned to receive amalgam fillings (black dots) and composite fillings (white dots) [Woods et al. EHP 115(10), 2007]. The error bars show the 95% confidence intervals. Which one of the following statements about the graph is correct?
The true mean of the population for that follow-up year is likely to fall within the error bar for that year.
In MATLAB, we use functions to perform specific activities. For example 'sum' is a function that performs addition. What are the "arguments" of a function?
They are the input values passed to the function so that it can perform its computation. These values appear in parentheses after the function name.
For the below MATLAB script, what do the square brackets ( [ ] ) indicate? byMonth = [ measlesByMonth', mumpsByMonth', CPByMonth' ]
They indicate a new array formed by placing the arrays together into a new variable, 'byMonth' .
In Hypothesis testing, the MATLAB function "ttest" compares a data set against a specified value based on a significant level.
True
In MATLAB, the combination of using the hold on and hold off commands allows you to plot multiple lines on the same graph.
True
The goal of a histogram is to display a "distribution" of data, where the x axis is a range or category.
True
Within MATLAB the condition statements in an If function and a Loop function are structured differently. You can not interchange the same code in both successfully.
True
In MATLAB a collection of data (say numbers or text values) in a single column or row is called a?
Vector
In Hypothesis testing, we use sample data. Which of the following is incorrect? (only one answer is incorrect)
We have access to the Full data set and our data is perfect.
Hypothesis Testing Analysis: (H Value) Suppose that the ttest2 code in MATLAB provided the following results -- h = 0, p = 0.565, and ci = [84.61, 85.21]. Which of the below answers best describes the results of the test?
With h = 0 - the alternative hypothesis has not been proven, so the null may be correct.
Hypothesis Testing Analysis: (H Value) Suppose that the ttest2 code in MATLAB provided the following results -- h = 1, p = 0.008, and ci = [82.75, 83.40]. Which of the below answers best describes the results of the test?
With h = 1 - the alternative hypothesis is accepted.
In MATLAB, the diff Function is used to calculate the differences with in a data set. Which of the below statements is FALSE when using the diff function.
Your resulting array variable will be the exact same size as the original array.
Trace the following loop. What is the value of x when the loop completes?
[ 5, 11, 8 ]
Suppose wakeHour is a 21 × 144 array containing wake up hour of each student in a 144-student cohort for sleep diaries recorded over a 21-day period. Similarly, bedHour is a 21×144 array containing the bed hour for the same students. Both the wakeHour and bedHour are given in 24-hour format relative to midnight on the wakeup day. Define variables that have the average bedHour and average wakeHour for each student in the cohort.
averageBedHour = mean(bedHour) averageWakeHour = mean(wakeHour);
The following table gives the counts of bacteria at two different beaches. The shaded portion of the table corresponds to the MATLAB variable called beaches. Which of the below scripts defines the variable beach2 that contains the bacterial count for beach 2.
beach1 = beaches( : , 3);
The following table gives the counts of bacteria at two different beaches. The shaded portion of the table corresponds to the MATLAB variable called beaches. Which of the below scripts defines the variable bothbeaches that contains the bacterial count colomns of both beaches.
beach1 = beaches( : , [ 2, 3]);
In Data Analysis, Rates of Change provides critical information about how your data changes from one point to the next. The Rate of Change is the [x] from one point to the next.
difference
In Nature Data Distributions can take on many forms. Below is one example of a typical distribution. What type of distribution does the above graph display?
exponential
In MATLAB, when you create a graph to track Rates of Change, you can use a plotyy function which puts different scales on the y axis. Based on the data in the graph above, what is the indication of the blue line after week 25?
fetal weight continued to increase during pregnancy
The graph above shows the total number of cases of 3 different childhood diseases in New York City (NYC) for the years 1931-1971. Approximately how many cases of measles occurred in January for the years 1931-1971?
fewer than 50,000 cases
In MATLAB, a For Loop Statement is used to repeat select code statements based on a specified number/condition. In the above code, which statement processed once the loop is finished with it's last pass?
fprintf('x = %g\n', x);
Which of the below statements is false when discussing "gca" in MATLAB?
gca stands for "graphic continuous axis"
Suppose: grades is a 50 x 5 array that holds grades for a class of 50 students for 5 different labs gender is a 50 element column vector holding a gender designation ('male' or 'female') for each member in the class age is a 50 element column vector holding the ages of the class members level is a 50 element column vector holding a number corresponding to their college level (1 = freshman) men = strcmp(gender, 'male') women = strcmp(gender, 'female') Which of the below scripts will create a new array containing the grades of the women in the class over 30?
gradesWomenOver30 = grades(women & age > 30, : )
One tool used when creating a histogram, is the square-root rule. This rule is used to help determine the adequate number of bins for your data. How is it calculated?
ideal bins = square root of the number of elements in the data set
Translating word problems into MATLAB code: Suppose traffic is a MATLAB array with 10 rows (one for each intersection) and 24 columns (one for each hour of the day) (10 x 24) representing the number of cars that transversed the intersection during that hour. Which of the following defines a MATLAB variable intersectionsByHour that contains the difference in traffic number from intersection to intersection for each hour of the day?
intersectionsByHour = diff(traffic, 1, 1);
Translating word problems into MATLAB code: Suppose traffic is a MATLAB array with 10 rows (one for each intersection) and 24 columns (one for each hour of the day) (10 x 24) representing the number of cars that transversed the intersection during that hour. Which of the following defines a MATLAB variable intersectionsByHour that contains the difference in traffic number from hour to hour for each intersection?
intersectionsByHour = diff(traffic, 1, 2);
In MATLAB, a For Loop Statement is used to repeat select code statements based on a specified number/condition. In the above code, which statement is the "Condition Statement"?
k = 1:3
Suppose a MATLAB variable grades is a 100 x 3 array holding the scores on three exams (1, 2, and 3 respectively) for a class of 100 students. Which of the following MATLAB statements finds the average of the scores on exam 1?
mean(grades(:, 1))
Suppose: grades is a 50 x 5 array that holds grades for a class of 50 students for 5 different labs gender is a 50 element column vector holding a gender designation ('male' or 'female') for each member in the class age is a 50 element column vector holding the ages of the class members level is a 50 element column vector holding a number corresponding to their college level (1 = freshman) Which of the below scripts will provide the total number of men in the class?
men = strcmp(gender,'male') numen = sum(men)
A lab gradebook for a class of 50 students is contained in a 50 × 4 array called 'grades' for the four labs in the course. In addition to the gradebook, the instructor keeps a gender array of size 50 × 1 containing the genders ('male', or 'female') of the students in the class. Define a variable containing the percentage of the students in the class who are male.
men = strcmpi(gender, 'male'); percentMen = 100*mean(men);
Suppose: grades is a 50 x 5 array that holds grades for a class of 50 students for 5 different labs gender is a 50 element column vector holding a gender designation ('male' or 'female') for each member in the class age is a 50 element column vector holding the ages of the class members level is a 50 element column vector holding a number corresponding to their college level (1 = freshman) men = strcmp(gender, 'male') Which two of the below scripts will create a new array holding just the grades of the men?
menGrades = grades(men, : )
In MATLAB we use several different functions to perform statistical computations. Which MATLAB Function returns the smallest value in the array (depending on the number of rows/columns and which dimension is provided)?
min function
Suppose: grades is a 50 x 5 array that holds grades for a class of 50 students for 5 different labs gender is a 50 element column vector holding a gender designation ('male' or 'female') for each member in the class age is a 50 element column vector holding the ages of the class members level is a 50 element column vector holding a number corresponding to their college level (1 = freshman) men = strcmp(gender, 'male') women = strcmp(gender, 'female') Which of the below scripts will create a new array holding the number of women who are seniors in college and over 30?
numSeniorWomenOver30 = sum(women & age > 30 & level == 4)
Suppose: grades is a 50 x 5 array that holds grades for a class of 50 students for 5 different labs gender is a 50 element column vector holding a gender designation ('male' or 'female') for each member in the class age is a 50 element column vector holding the ages of the class members level is a 50 element column vector holding a number corresponding to their college level (1 = freshman) men = strcmp(gender, 'male') women = strcmp(gender, 'female') Which of the below scripts will create a new array holding the number of women in the class between the ages of 25 and 30 inclusive?
numWomen25to30 = sum(women & (age >=25 & age <=30))
Suppose wakeHour is a 21 × 144 array containing wake up hour of each student in a 144-student cohort for sleep diaries recorded over a 21-day period. Similarly, bedHour is a 21×144 array containing the bed hour for the same students. Both the wakeHour and bedHour are given in 24-hour format relative to midnight on the wakeup day. Define a variable that has the overall correlation between bedHour and wakeHour for the students in the cohort.
overallCorr = corr(bedHour(:), wakeHour(:));
Suppose a MATLAB variable A is defined by: A = [ 10, 15, 6, 4; 11, 4, 7, 3; 5, -1, -3, 12 ] To access the individual elements of an array, you give MATLAB indices in parentheses. Suppose you define a new variable B with the below script B = A(3, 1) The first indice (in this case the value is 3) tells you to take the value from
row 3
When creating logical arrays from data arrays, you can use Six Operational Operators on numeric data == Equals `= Not equal > Greater Than < Less Than >= Greater Than or equal to <= Less than or equal to These can be used when the data is a number. Which of the the below can be used on text data (String Operator)?
strcmp
Suppose a MATLAB variable grades is a 100 x 3 array holding the scores on three exams (1, 2, and 3 respectively) for a class of 100 students. Which of the following MATLAB statements finds the number of exam scores that are over 50?
sum(grades(:) > 50)
Which of the below scripts creates a variable containing the MAD for our single vector array called 'testarray'?
testarrayMAD = mad(testarray, 1, 1)
In hypothesis testing, which of the following is incorrect about the confidence intervals?
the probability of getting a bad draw.
In MATLAB, when you create a graph to track Rates of Change, you can use a plotyy function which puts different scales on the y axis. Based on the data in the graph above, what is the indication of the green line down swing following week 35?
the rate of growth dramatically decreased
Causality is the generic connection of phenomena through which one thing (the cause). Under certain conditions, give raise to, causes something else (the effect).
true
A correlation value close to 1 means:
two data sets vary together
In Nature Data Distributions can take on many forms. Below is one example of a typical distribution. What type of distribution does the above graph display?
uniform
Suppose: grades is a 50 x 5 array that holds grades for a class of 50 students for 5 different labs gender is a 50 element column vector holding a gender designation ('male' or 'female') for each member in the class age is a 50 element column vector holding the ages of the class members level is a 50 element column vector holding a number corresponding to their college level (1 = freshman) men = strcmp(gender, 'male') Which of the below scripts will create a new array holding the number of women in the class over 30?
women = strcmp(gender, 'female') womenOver30 = women & ( age > 30) numWomenOver30 = sum(womenOver30)
A lab gradebook for a class of 50 students is contained in a 50 × 4 array called 'grades' for the four labs in the course. In addition to the gradebook, the instructor keeps a gender array of size 50 × 1 containing the genders ('male', or 'female') of the students in the class. Define a variable containing only the grades of the students who are female.
women = strcmpi(gender, 'female'); femaleGrades = grades(women, :);
In MATLAB, IF statements are use to process specific/select code based on conditions. Based on the above code, which part of the script is the "Condition Statement"?
x <= 40
In MATLAB, you can use your For Loop Condition variables within your execution code. In the above code, k is the condition variable and x is an array with existing elements? The execution statement uses k as array index (which position in the array). What are the values of x after the code is executed?
x = [ 2, 8, 17, 29 ]
In MATLAB, a For Loop Statement is used to repeat select code statements based on a specified number/condition. In the above code, which statement is repeated until the condition is false?
x = x + k*k;
In MATLAB, IF statements are use to process specific/select code based on conditions. Based on the above code, which part of the script is executed if the condition is "True"?
y = x + 3;
In MATLAB, IF statements are use to process specific/select code based on conditions. Based on the above code, which part of the script is executed if the condition is "False"?
y = y + 10;
Which of the below formulas is the correct formula for generating a line. Where m is slope (rise over run) and b is the y intercept.
y=mx+b
In hypothesis testing, if the p-value is less than ( < ) the significance level,
you have enough evidence to accept the alternative hypothesis test.
In Hypothesis testing, if you do not accept that alternative hypothesis
you will accept the Null hypothesis, but not fully believe it is correct. It is probable but there may be other solutions that would also work.
In a MATLAB fprintf function what does the % represent?
It is a format specifier or rule for outputting an argument.
Suppose a MATLAB variable A is defined by: A = [ 10, 15, 6, 4; 11, 4, 7, 3; 5, -1, -3, 12 ] Click on the array that shows A'
*picture is answer
Suppose a MATLAB variable A is defined by: A = [ 10, 15, 6, 4; 11, 4, 7, 3; 5, -1, -3, 12 ] Click on the array that shows A in Tabular Form.
*picture is answer*
Suppose a MATLAB variable A is defined by: A = [ 10, 15, 6, 4; 11, 4, 7, 3; 5, -1, -3, 12 ] Click on the array that shows A(:)
*picture is answer*
Suppose a MATLAB variable A is defined by: A = [ 10, 15, 6, 4; 11, 4, 7, 3; 5, -1, -3, 12 ] Click on the array that shows the results found in array B after you run the below script. B = sum(A)
*picture is answer*
Suppose a MATLAB variable A is defined by: A = [ 10, 15, 6, 4; 11, 4, 7, 3; 5, -1, -3, 12 ] Click on the array that shows the results found in array B after you run the below script. B = sum(A, 2)
*picture is answer*
Suppose the MATLAB variable exampleArray is defined by: exampleteArray = [ 4, 6, 10; 11, 7, 6; 0, -1, -4]; Click on the array that shows the results of the MATLAB command: x = max(exampleArray, 2))
*picture is answer*
Suppose the MATLAB variable exampleArray is defined by: exampleteArray = [ 4, 6, 10; 11, 7, 6; 0, -1, -4]; Click on the array that shows the results of the MATLAB command: x = median(exampleArray)
*picture is answer*
Suppose the MATLAB variable exampleArray is defined by: exampleteArray = [ 4, 6, 10; 11, 7, 6; 0, -1, -4]; Click on the array that shows the results of the MATLAB command: x = min(exampleArray, [ ], 2)
*picture is answer*
In statistics, average error uses the mean as the predictor and measures all the data points in the array against the mean to determine how far off each data point is from that mean. It then calculates the average of all those error values to come up with average error. Where x is the array and the deviation is measured by taking " x - avg of x " for each data point. To get the average error you divide the total of all the errors by the number of elements. Given a x = [ -1, -1, 2 , 4 ] (average is 1 and median is .05) Which of the below answers provides the average error for x?
0
In MATLAB a function is a group of statements that perform a task. Functions can accept more than one input argument and may return more than one output argument. Below is script syntax using the SUM function. B = sum(A, 1) What dimension will MATLAB sum over (process across to do the addition)?
1
In statistics, Median Absolute Deviation (MAD) uses the median as the predictor and measures all the data points in the array against the median to determine how far off each data point is from that median. It then takes the absolute value (removing all negatives) for those values. Finally, it sorts the data values from smallest to largest and finds the median value from that grouping to come up with the MAD. Where x is the array and the deviation is measured by taking the absolute value of x - median of x or |x - med of x| for each data point. To get the MAD you sort all the values and find the median of that group. Given a x = [ -1, -1, 2 , 4 ] (average is 1 and median is .05) Which of the below answers provides the MAD for x?
1.5
In MATLAB you can put arrays together to create new variables using coma and semicolons. Suppose you have two arrays: a = [ 10; 14; 6 ] and b = [ 1; 3; 6 ] Given you create a new variable called ab; ab = [ a ; b] How would the elements of the results be displayed?
10, 14, 6, 1, 4, 6
In MATLAB arrays are displayed in the Workspace after they have been initialized in a script (loaded or created). Given the above variables, how many columns does the chickenPox array contain?
12
Suppose a MATLAB variable A is defined by: A = [ 5, 6, 9; 5, 2, 11 ] Given below MATLAB script. c = sum(A,2); What are the value(s) in the array c?
18
In statistics, Average Absolute Deviation (AAD) uses the mean as the predictor and measures all the data points in the array against the mean to determine how far off each data point is from that mean. It then takes the absolute value (removing all negatives) for those values. Finally, it then calculates the average of all those error values to come up with AAD. Where x is the array and the deviation is measured by taking the absolute value of x - average of x or |x - avg of x| for each data point. To get the AAD you divide the total of all the errors by the number of elements. Given a x = [ -1, -1, 2 , 4 ] (average is 1 and median is .05) Which of the below answers provides the AAD for x?
2
In statistics, another common measure of spread is Standard Deviation which uses the squares of the errors instead of absolute values of errors. First, you determine the error by taking each data element, one by one and subtracting the mean. Next you square each of those values individually. Variance (of the sample) is the average squared error (usually called the mean squared error or MSE) of data from the mean. Average the squared errors (add all the squares and divide by the number of elements) to get the Variance. Because we squared the data, it is not in the correct units, so you need to take the square root of the Variance to get Standard Deviation. Standard Deviation (of the sample) is the square root of the average squared error of data (Variance) from the mean (sometimes called RMS error). Given a x = [ -1, -1, 2 , 4 ] (average is 1 and median is .05) Which of the below answers provides the Standard Deviation for x?
2.1213
In statistics, another common measure of spread is Standard Deviation which uses the squares of the errors instead of absolute values of errors. First, you determine the error by taking each data element, one by one and subtracting the mean. Next you square each of those values individually. Variance (of the sample) is the average squared error (usually called the mean squared error or MSE) of data from the mean. Average the squared errors (add all the squares and divide by the number of elements) to get the Variance. Because we squared the data, it is not in the correct units, so you need to take the square root of the Variance to get Standard Deviation. Standard Deviation (of the sample) is the square root of the average squared error of data (Variance) from the mean (sometimes called RMS error). Given a x = [ -1, -1, 2 , 4 ] (average is 1 and median is .05) Which of the below answers provides the Varience for x?
4.5
In MATLAB arrays are displayed in the Workspace after they have been initialized in a script (loaded or created). Given the above variables, how many rows does the chickenPox array contain?
41
In MATLAB several functions default to along the first non-singleton dimension, if you do not provide a dimension argument. This means that if the array provided is: a vector of single row of values a vector of a single column of values MATLAB will perform the computation across that single vector (if no dimension argument is provided). However, if your variable is an array with multiple rows or columns, and you do NOT include a dimension argument, MATLAB will default to dimension 1 (transversing the computations down the rows). Given the MATLAB Variable: C = [ 6, 8, 10 ; 12, 4, 11] Which answer below provides the value of E if: E = min(C, [ ] , 2).
6 4
In MATLAB several functions default to along the first non-singleton dimension, if you do not provide a dimension argument. This means that if the array provided is: a vector of single row of values a vector of a single column of values MATLAB will perform the computation across that single vector (if no dimension argument is provided). However, if your variable is an array with multiple rows or columns, and you do NOT include a dimension argument, MATLAB will default to dimension 1 (transversing the computations down the rows). Given the MATLAB Variable: C = [ 6, 8, 10 ; 12, 4, 11] Which answer below provides the value of E if: E = median(C).
9
The above table shows the number of cases (in thousands) of measles and mumps in New York City for the years 1940 to 1944. How many cases of measles occurred in New York City during the period 1940-1942?
90,000
The side-by-side (left) and stacked (right) bar graphs below show the same information. The data is from lesson 1 (count.dat) and tracks vehicles thru 3 specific intersections. The graphs below are a sub set of the overall data and display the data from 9am to 5pm. For the side-by-side graph, what does each bar in the graph represent?
An individual bar represents the total number of cars that passed thru a unique intersection during a specific hour.
In MATLAB the values in an array or vector are called?
Elements
In MATLAB, when working with an array, the application needs information in order to perform calculations. It needs to know which rows or columns to use if you don't want to work with the entire set. MATLAB uses what to tell the system which rows or columns to use?
Dimensions; Dimension 1 is rows, Dimension 2 is columns
In MATLAB, Variables are "Case Sensitive" (MATLAB treats variables differently depending on whether it has capitals or lowercase text). If you define a variable below newvariable = A + B TRUE OR FALSE MATLAB will let you interchange any combination of variations of the word newvariable later in the script so newvariable, NewVariable, newVariable, NeWvAriable are all the same as far as the script/MATLAB and are all assigned the same value.
False
Referencing the Data Triangle, data is:
Individual Values with no Context
Suppose a MATLAB variable A is defined by: A = [ 10, 15, 6, 4; 11, 4, 7, 3; 5, -1, -3, 12 ] What does the equal sign do?
It is the assignment operator. MATLAB computes a value from the expression on the right and assigns the results to the variable on the left.
The side-by-side (left) and stacked (right) bar graphs below show the same information. The data is from lesson 1 (count.dat) and tracks vehicles thru 3 specific intersections. The graphs below are a sub set of the overall data and display the data from 9am to 5pm. What hour of the day has the least amount of traffic thru these intersections? When are the busiest hours of traffic?
Least: 11am Busiest: 9am
Which two of the MATLAB measures of spread are LEAST sensitive to outliers?
MAD and IQR
What is Linear Representation (:) and how does it work in MATLAB?
MATLAB forms the linear representation by placing the columns of an array, end to end to make a single vertical column.
The MATLAB subplot function allows you to arrange your graphs within a single figure. It tiles or places your graphs in a mosaic based on the following syntax. subplot(m, n, p) What does n stand for?
Number of columns in the mosaic
The MATLAB subplot function allows you to arrange your graphs within a single figure. It tiles or places your graphs in a mosaic based on the following syntax. subplot(m, n, p) What does m stand for?
Number of rows in the mosaic
What type of chart is best for showing percentages that each element in a vector or matrix contributes to the sum of all elements? Best for showing percentages of a whole?
Pie Chart
The MATLAB subplot function allows you to arrange your graphs within a single figure. It tiles or places your graphs in a mosaic based on the following syntax. subplot(m, n, p) What does p stand for?
Position the specific graph has in the mosaic
In MATLAB a single data point is called?
Scalar
In a MATLAB fprintf function what does the first argument represent?
The first argument is the format string, which controls the appearance of the output.
What does the fprintf function do?
The function outputs the arguments provided between the parentheses to the command window. It can also be used to output to a file.
In MATLAB, array nomenclature typically provides the row and column dimension as ( row x column). TRUE OR FALSE Array 'householdDogs" (10x50) would indicate the array householdDogs has 10 rows and 50 columns.
True
In MATLAB, the subplot commands allows you to display multiple graphs in the same figure.
True
Is the Below statement true or False? A variable is a way of holding data in a program. Variables have names and values. The value of the variable is the data that the variable holds. You can refer to the data by the variable's name. You can change the value of a variable by assigning it a new value (hence the name variable)
True
Which of the below statements is NOT true about Variables?
Variables can never be changed once they are set for the first time in the script.
Mean and Median both provide measures of "central tendency". A measure of central tendency is a single value that describes the way in which a group of data cluster around a central value. To put in other words, it is a way to describe the center of a data set. Why is it important to get the mean and median of your data set?
When the mean and median are far apart in value, you can surmise that there must be some outliers in the data.
When would you use a "stacked bar" chart?
When you want to show a better estimate and comparison of the overall totals of the group. You can comprehend a larger number of groups with this type of chart.
In MATLAB several functions default to along the first non-singleton dimension, if you do not provide a dimension argument. This means that if the array provided is: a vector of single row of values a vector of a single column of values MATLAB will perform the computation across that single vector (if no dimension argument is provided). However, if your variable is an array with multiple rows or columns, and you do NOT include a dimension argument, MATLAB will default to dimension 1 (transversing the computations down the rows). Given the MATLAB Variable: C = [ 6, 8, 10 ; 12, 4, 11] Which answer below provides the value of E if: E = max(C).
[12, 8, 11 ]
In MATLAB, the "bar" function acts similar to the "plot" function, however instead of creating a line chart it creates?
a chart with vertical squares representing the value of the elements in the vector.
In statistics the sample Standard Deviation (where you divide by the number of data elements in the sample) is not a good example of a sample predicting the overall characteristics of a population because it provides to much emphasis (bias) on the lower data values in the sample set. A small correction factor can improve this estimate. Dividing the n-1 (one element less than the original number of data elements) instead when taking the average. This is called the unbiased estimator of the population variance. The Standard Deviation (unbiased estimator of the population - pop est) is just the square root of the unbiased estimator of the population variance. In MATLAB we use the std function with an additional argument in the second position to indicate if we are calculating the standard deviation with the unbiased estimator or if we are using actual standard deviation (sometimes called sample SD). Which of the below MATLAB scripts, indicates using the unbiased estimator for standard deviation?
b = std( A, 0, dim)
The following table gives the counts of bacteria at two different beaches. The shaded portion of the table corresponds to the MATLAB variable called beaches. Given we define the following variables in our MATLAB script beach1 = beaches(:,2); beach2 = beaches(:,3); bothBeaches = beaches(:, [2,3]); beach1Total = sum(beach1); beachesTotal = sum(bothBeaches(:)); Which of the scripts below define a variable that holds the percentage of total bacteria represented by Beach 1?
beach1Percent = 100.*beach1Total./beachesTotal;
The following table gives the counts of bacteria at two different beaches. The shaded portion of the table corresponds to the MATLAB variable called beaches. Given we define the following variables in our MATLAB script beach1 = beaches(:,2); beach2 = beaches(:,3); bothBeaches = beaches(:, [2,3]); Which of the scripts below define an variable that holds the total bacterial count for beach 1?
beach1Total = sum(beach1);
The following table gives the counts of bacteria at two different beaches. The shaded portion of the table corresponds to the MATLAB variable called beaches. Given we define the following variables in our MATLAB script beach1 = beaches(:,2); beach2 = beaches(:,3); bothBeaches = beaches(:, [2,3]); Which of the scripts below define a variable that holds the overall total bacterial count for both beaches?
beachesTotal = sum(bothBeaches(:));
The following table gives the counts of bacteria at two different beaches. The shaded portion of the table corresponds to the MATLAB variable called beaches. Given we define the following variables in our MATLAB script beach1 = beaches(:,2); beach2 = beaches(:,3); bothBeaches = beaches(:, [2,3]); Which of the scripts below define a variable that holds the total bacterial count for day 5?
day5Total = sum(bothBeaches(2,:));
In MATLAB functions max and min, the second argument does NOT correspond to the dimension. When the second argument isn't empty ( [ ] ) , the function does an element by element comparison between the corresponding first and second arguments. Given the MATLAB variable: C = [ 6, 10, 8; 11, 13, 4] Which of the answers below both give the same results?
max(C) max(c, [ ], 1)
In MATLAB we use several different functions to perform statistical computations. Which MATLAB Function returns the average (adding all the values in the array and dividing by the number of elements).
mean function
In MATLAB arrays are displayed in the Workspace after they have been initialized in a script (loaded or created). Given the above variables, which array is a single vector with 1 row and with 12 columns?
measlesByMonth
In MATLAB we use several different functions to perform statistical computations. Which MATLAB Function returns the middle value after sorting the values in the array?
median function
The following table gives the counts of bacteria at two different beaches. The shaded portion of the table corresponds to the MATLAB variable called beaches. Given we define the following variables in our MATLAB script beach1 = beaches(:,2); beach2 = beaches(:,3); bothBeaches = beaches(:, [2,3]); beach1Total = sum(beach1); beachesTotal = sum(bothBeaches(:)); Which of the scripts below define a variable that holds the percentage of beach 1's count that occurs on Day 15?
percentDay15 = 100.*beach1(6)./beach1Total;
Suppose a MATLAB variable A is defined by: A = [ 10, 15, 6, 4; 11, 4, 7, 3; 5, -1, -3, 12 ] In this script, the coma (,) tells MATLAB to
separate items within the row
Suppose a MATLAB variable A is defined by: A = [ 10, 15, 6, 4; 11, 4, 7, 3; 5, -1, -3, 12 ] In this script, the semicolon (;) tells MATLAB to
start a new row
Suppose a MATLAB variable A is defined by: A = [ 10, 15, 6, 4; 11, 4, 7, 3; 5, -1, -3, 12 ] To access the individual elements of an array, you give MATLAB indices in parentheses. Suppose you define a new variable C with the below script, C = A( : , 1) What does the colon mean?
take everything in that row or column
Which of the below scripts creates a variable containing the AAD for our single vector array called 'testarray'?
testarrayAAD = mad(testarray, 0, 1)
In statistics the interquartile range (IQR) starts with sorting all the values in your sample from smallest to largest. It identifies markers in the data set that indicate specific points in the data set. The first is the 25th percentile at which point, 1/4 of data values are smaller than this point. The 75th percentile is such that 3/4 of the data values are smaller than this point. The IQR is the 75th percentile minus ( - ) the 25th percentile. In MATLAB, the iqr function ( a = iqr(x, dim) ) provides a single number that represents the 75th percentile minus the 25 percentile. We also use the prctile function to generate the values for both the 75 percentile point and the 25 percentile point -- a = prctile(x, [25, 75], dim) . This function gives us the two end points of the IQR range. Which of the below MATLAB scripts, generates two numbers that represent the 25th and 75th percentile or our array testarray ?
testarrayIQR = prctile(testarray, [25, 75], 1)
Which of the below measures of spread is the most commonly used?
unbiased estimator of population standard deviation