CS1173 8-15

Réussis tes devoirs et examens dès maintenant avec Quizwiz!

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

Suppose x is a MATLAB variable x = [ -2, 3, 1; 0, 4, -1] Find y = diff(x,1, 2)

5 -2 4 -5

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

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

Correlation is?

a measure of the statistical relationship between two different data sets

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

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.

Which of the below statements about Logical Arrays in MATLAB is false?

They end up one column/row less than the original.

Causality is the generic connection of phenomena through which one thing (the cause), under certain conditions, gives raise to, causes something else (the effect).

True

In Hypothesis testing, the MATLAB function "ttest" compares a data set against a specified value based on a significant level.

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

The goal of a histogram is to display a "distribution" of data, where the x axis is a range or category.

True

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.

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

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

In the above code, which statement processed once the loop is finished with it's last pass?

fprintf('x = %g\n', x);

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

Which of the below statements about Hypothesis Testing is FALSE?

It uses a full data set instead of a sample.

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

MATLAB does not allow you to generate linear models

On a boxplot, what does the position of the top whisker represent?

Max value in the data set (within 1.5*IQR)

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 Squar 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)

Based on the above code, what is the value of "y" after the script is completed??

38

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

An additional data point is added to the data set having a mean child beak size of 8 and a mean parent beak size of 9,3. What is the error between this new measurement and its predicted value?

.96

Within MATLAB, Logical Vector arrays are based on applying a condition to an existing array. When the condition is false, what is the corresponding element placed in the logical array?

0

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

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

When creating a Histogram in MATLAB, the default number of bins is:

10

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 the above code, what is the value of x after the code is completed?

19

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

On a boxplot, what does the position of the bottom of the box represent?

25% value in the data set

In the above code, how many times will the selected code be repeated?

3

Based on the data in the graph above, when is the peak fetal growth rate?

35

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

Based on the data in the graph above, what is the approximate fetal weight at week 40?

8 lbs

The following scatter plot shows the relationship between mean parent beak sizes and mean child beak sizes. The best fit linear fit (linear model) is displayed on the graph. What is the average beak size of a child if the parent beak size is 10.5? You can use the best fit line to help make your calculation.

9.89

On the box plot above, what is the median Wake Time of Section 3?

9:00am

What is the definition of a histogram?

A graphical display of a frequency table, usually using bars to present counts.

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.

In hypothesis testing, MATLAB provides a P-Value. Which of the following is incorrect?

Is always set to 5% or .05.

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 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.

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 difference from one point to the next.

The If function allows you to:

Process select code based on conditions.

The Loop function allows you to:

Repeat select code based on conditions.

Which of the below statements about Box Plots is False?

Requires each data set to be the exact same size

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

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.

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

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 the above code, which statement is the "Condition Statement"?

k = 1:3

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)

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(strcmp(gender, 'male'), : ) menGrades = grades(men, : )

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

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))

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

In hypothesis testing, which of the following is incorrect about the confidence intervals?

the probability of getting a bad draw.

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 descreased

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 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

On a boxplot, what does the position of the plus signs mean?

values outside 1.5*IQR (it is an outlier)

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)

Based on the above code, which part of the script is the "Condition Statement"?

x <= 40

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 the above code, which statement is repeated until the condition is false?

x = x + k*k;

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

Based on the above code, which part of the script is executed if the condition is "True"?

y = x + 3;

Based on the above code, which part of the script is executed if the condition is "False"?

y = y + 10;


Ensembles d'études connexes

Chapter 12: Congenital and Acquired Immunodeficiencies, Diseases Caused by Defective Immunity

View Set

Chapter 8: Cities of Sub-Saharan Africa

View Set

Chapter Ten - Race and Ethnicity

View Set

Information Security Exam Questions

View Set

PE-Chapter 4: Preparing for Physical Activity.

View Set