1. The larger the calculated χ2 value in a goodness-of-fit test, the _______ likely the data fits the hypothesized distribution.
2.
If the observed frequencies are exactly equal to the expected frequencies in a chi-square test, the value of χ2 is:
a. close to 1
b. a large positive value
c. 0
d. a very small positive value
3. A chi-square statistic can be used to analyze contingency tables:
True or False
4. The chi-square statistic for a 6x4 contingency table will have ____ degrees of freedom.
5. The chi-square test can be used to determine if there is a significant difference between two sample proportions:
True or False
6. Which of the following null hypotheses cannot be tested with a chi-squared test?
a. Ho: the two variables defining the contingency table are independent.
b. Ho: the population distribution is a normal distribution.
c. Ho: the true category proportions are the same for all of the population.
d. Ho: the true population means are the same for all of the populations
7. To test the null hypothesis that a population proportion is p = 0.40 using a sample size of n = 12, we use the ____________ distribution.
a. t
b. normal
c. binomial
d. chi-square
8. The null hypothesis that two processes produce the same proportion of defectives can be written:
a. p = 0
b. x1/n1 = x2/n2
c. p1 - p2 = 0
d. x/n = 0
9. The chi-square distribution is symmetrical:
True or False
10. The test statistics for a small-sample test concerning proportion is the ___________. [hint: use all lowercase letters]
In: Math
#include <iostream>
#include <fstream>
#include <vector>
#include <string>
using namespace std;
// Define a Person class, including age, gender, and
yearlyIncome.
class Person {
public:
Person();
void Print();
void SetData(int a); // FIXME Also set gender and yearly
income
void SetGender(string gender);
void SetIncome(int income);
int GetAge();
string GetGender();
int GetIncome();
private:
int age;
string gender;
int yearlyIncome;
};
// Constructor for the Person class.
Person::Person() {
age = 0;
gender = "default";
yearlyIncome = 0;
return;
}
// Print the Person class.
void Person::Print() {
cout << "Age = " << this->age
<< ", gender = " << this->gender
<< ", yearly income = " << this->yearlyIncome
<< endl;
return;
}
// Set the age, gender, and yearlyIncome of a Person.
void Person::SetData(int a) { // FIXME Also set gender and yearly
income
this->age = a;
return;
}
void Person::SetGender(string gender){
this->gender = gender;
}
void Person::SetIncome(int income){
this->yearlyIncome = income;
}
// Get the age of a Person.
int Person::GetAge() {
return this->age;
}
string Person::GetGender(){
return this->gender;
}
int Person::GetIncome() {
return this->yearlyIncome;
}
// Get a filename from program arguments, then make a Person for
each line in the file.
bool ReadPeopleFromFile(int argc, char* argv[],
vector<Person> &people) {
Person tmpPrsn;
ifstream inFS;
int tmpAge = 0;
string tmpGender = "";
int tmpYI = 0;
if (argc != 2) {
cout << "\nUsage: [EXECUTABLE FILE] [TEXT DATA FILE], e.g.
myprog.exe dev_people.txt" << endl;
return true; // indicates error
}
cout << "Opening file " << argv[1] <<
".\n";
inFS.open(argv[1]); // Try to open file
if (!inFS.is_open()) {
cout << "Could not open file " << argv[1] <<
".\n";
return true; // indicates error
}
while (!inFS.eof()) {
inFS >> tmpAge;
inFS >> tmpGender;
inFS >> tmpYI;
tmpPrsn.SetData(tmpAge); // FIXME Also set gender and yearly
income
tmpPrsn.SetGender(tmpGender);
tmpPrsn.SetIncome(tmpYI);
tmpPrsn.Print();
people.push_back(tmpPrsn);
}
inFS.close();
cout << "Finished reading file." << endl;
return false; // indicates no error
}
// Ask user to enter age range.
void GetUserInput(int &ageLowerRange, int &ageUpperRange,
string &gender, int &yILowerIncome,int &yIHigherIncome)
{
cout<<"\nEnter lower range of age: ";
cin >> ageLowerRange;
cout << "Enter upper range of age: ";
cin >> ageUpperRange;
cout << "Enter the gender: ";
cin >> gender;
cout << "Enter the lower range of yearlyIncome: ";
cin >> yILowerIncome;
cout << "Enter the higher range of yearlyIncome: ";
cin >> yIHigherIncome;
return;
}
// Return people within the given age range.
vector<Person> GetPeopleInAgeRange(vector<Person> ppl,
int lowerRange, int upperRange) {
unsigned int i = 0;
vector<Person> pplInAgeRange;
int age = 0;
for (i = 0; i < ppl.size(); ++i) {
age = ppl.at(i).GetAge();
if ((age >= lowerRange) && (age <= upperRange))
{
pplInAgeRange.push_back(ppl.at(i));
}
}
return pplInAgeRange;
}
// Return people with same Gender.
vector<Person>
GetPeopleWithSpecificGender(vector<Person> ptntlCstmrs,string
gender){
vector<Person> pplWithSameGender;
string gndr;
for (int i=0;i<ptntlCstmrs.size();i++){
gndr = ptntlCstmrs.at(i).GetGender();
if (gndr.compare(gender) == 0){
pplWithSameGender.push_back(ptntlCstmrs.at(i));
}
}
return pplWithSameGender;
}
// Return people within the given income range.
vector<Person> GetPeopleInIncomeRange(vector<Person>
ptntlCstmrs,int lowerRange, int higherRange){
vector<Person> pplInIncomeRange;
int range = 0;
for (int i=0;i<ptntlCstmrs.size();i++){
range = ptntlCstmrs.at(i).GetIncome();
cout << range << endl;
if ((range >= lowerRange) && (range <=
higherRange)){
pplInIncomeRange.push_back(ptntlCstmrs.at(i));
}
}
return pplInIncomeRange;
}
int main(int argc, char* argv[]) {
vector<Person> ptntlCstmrs;
bool hadError = false;
int ageLowerRange = 0;
int ageUpperRange = 0;
string gender;
int yILowerIncome = 0;
int yIHigherIncome = 0;
hadError = ReadPeopleFromFile(argc, argv, ptntlCstmrs);
if( hadError ) {
return 1; // indicates error
}
GetUserInput(ageLowerRange, ageUpperRange, gender,
yILowerIncome, yIHigherIncome );
ptntlCstmrs = GetPeopleInAgeRange(ptntlCstmrs, ageLowerRange,
ageUpperRange);
ptntlCstmrs =
GetPeopleWithSpecificGender(ptntlCstmrs,gender);
ptntlCstmrs =
GetPeopleInIncomeRange(ptntlCstmrs,yILowerIncome,yIHigherIncome);
cout << "\nNumber of potential customers =
"<<ptntlCstmrs.size() << endl;
return 0;
}
this is my code for my assignment, my professor said i'm missing
Based on that rubric, it looks like the code is missing two
things:
* Person class in separate files
* Output persons with user-entered gender works for "any"
can someone help me with this?
In: Computer Science
Draw and label a schematic of an Ag/AgCl reference electrode. As
part of your answer, include the ½ reaction that is utilized by
this electrode and include a description of how reference
electrodes are utilized in electrochemicalmeasurements
In: Chemistry
Garrett Kelly. Corporation's identified their current production capacity to range from 6,500 units to 22,000 units. when it produced and sold 12,000 units, its average costs per unit are as follows:
| Average Cost per Unit | |
| Direct Materials | 5.75 |
| Direct Labor | 4.25 |
| Variable manufacturing overhead | 1.75 |
| Fixed Manufacturing Overhead | 4.50 |
| Fixed Selling Expense | 1.75 |
| Fixed Administrative Expense | 0.90 |
| Sales Commissions | 0.75 |
| Variable Administrative Expense | 1.50 |
1) If 15,000 units are produced, the total amount of
Prime Costs incurred is closest to: ______
2) Determine the Conversion Costs for 11,000
units.
3) Determine the Total Product Costs for 12,000
units.
4) Detemine Total Period Costs when 12,000 units
are sold.
In: Accounting
A capacitor is made from two hollow, coaxial, iron cylinders, one inside the other. The inner cylinder is negatively charged and the outer is positively charged; the magnitude of the charge on each is 12.0 pC . The inner cylinder has a radius of 0.500 mm , the outer one has a radius of 7.60 mm , and the length of each cylinder is 24.0 cm .
Part A
What is the capacitance?
Use 8.854×10−12 F/m for the permittivity of free space.
C=___ F
Part B
What applied potential difference is necessary to produce these charges on the cylinders?
V=___ V
In: Physics
In radical chlorination of alkanes, non-equivalent hydrogens react with chlorine atoms at different rates. At 35
In: Chemistry
State whether each of the following events will result in a
movement
along the demand curve for McDonald’s Big Mac hamburger or
whether
it will cause the curve to shift. If the demand curve shifts
indicate
whether it will shift to the right or to the left, and draw the
graph to
illustrate the shift. Briefly explain your answers.
a. The price of Burger King’s Whopper hamburger declines.
b McDonald’s distributes coupons that offer a $3 discount on
the
purchase of a Big Mac.
c Because of the shortage of potatoes, the price of French
fries
increases.
In: Economics
Need someone to fix my code: based on this version, give me another version without adding struct student.
#include <iostream>
#include <iomanip>
using namespace std;
struct student
{
double firstQuizz;
double secondQuizz;
double midTerm;
double finalTerm;
double overallScore;
char gradeLetter;
string name;
};
void getStudentData(student &s);
void calcPercentage(student &s);
void gradeLetter(student &s);
void display(student s[],int n);
int main()
{
int n;
cout<<"enter the number of students"<<endl;
cin>>n;
struct student students[n];
int i; struct student istudent;
for(i=0;i<n;i++)
{
cout<<":: Student#"<<(i+1)<<"
::"<<endl;
getStudentData(students[i]);
}
for(i=0;i<n;i++)
{
calcPercentage(students[i]);
gradeLetter(students[i]);
}
display(students,n);
return 0;
}
void getStudentData(student &s)
{
cin.ignore();
cout<<"Student name?";
getline(cin,s.name);
cout<<"Enter marks in first quizz :";
cin>>s.firstQuizz;
cout<<"Enter marks in second quizz :";
cin>>s.secondQuizz;
cout<<"Enter marks in mid term :";
cin>>s.midTerm;
cout<<"Enter marks in final term :";
cin>>s.finalTerm;
}
Programming language: C++
void calcPercentage(student &s)
{
double overAllScore = (s.firstQuizz + s.secondQuizz)*5 * 0.25 +
s.midTerm * 0.25 + s.finalTerm* 0.50;
s.overallScore=overAllScore;
}
void gradeLetter(student &s)
{
double average=s.overallScore;
char gradeLetter;
if (average >= 90 && average<=100)
gradeLetter = 'A';
else if (average >= 80 && average < 90)
gradeLetter = 'B';
else if (average >= 70 && average < 80)
gradeLetter = 'C';
else if (average >= 60 && average < 70)
gradeLetter = 'D';
else if (average < 60)
gradeLetter = 'F';
s.gradeLetter=gradeLetter;
}
void display(student s[],int n)
{
//setting the precision to two
decimal places
std::cout << std::setprecision(2) <<
std::fixed;
cout<<setw(15)<<left<<"Name"<<setw(15)<<right<<"Overall
Score"<<setw(15)<<right<<"Grade
Letter"<<endl;
cout<<setw(15)<<left<<"----"<<setw(15)<<right<<"-------------"<<setw(15)<<right<<"------------"<<endl;
for(int i=0;i<n;i++)
{
cout<<setw(15)<<left<<s[i].name<<setw(15)<<right<<s[i].overallScore<<setw(15)<<right<<s[i].gradeLetter<<endl;
}
}
Programming language: C++
Requirement: based on this version, give me another version without adding struct student.
In: Computer Science
In: Economics
Given a value of the money supply that the Fed chooses, the equilibrium interest rate can be read off of the money demand schedule. The quantity of money demanded (Md) depends negatively on the interest rate. An increase in P and/or Y shifts the money demand curve to the right. Assume that the inverse money demand is given as r = (10+Y) -0.05 Md. Y =$19.1 (trillion) and Ms=581.1. Using Excel create a spreadsheet with the column headings Ms, r, Md, and M*P. Let’s sstart with no inflation, i.e., P=1.00. Fill in the spreadsheet’s cells for r= 0.035 to r=0.060 in increments of 0.001. (Note: All your answers should be rounded to the nearest thousandth (third digits after the decimal point. Ex: 0.0143 =>0.014, 0.1866=> 0.187) What is the equilibrium interest rate? ______ How much of the money is demanded by the economy at the equilibrium interest rate? ______ Assume that the nation’s GDP increased from 19.1 to 19.2. What happens in the money market at the existing interest rate? ______ (shortage or surplus) of money by $ ______ What is the eventual interest rate as a result of increase in GDP? ______ Assume that the price level increased by 0.5% during the year. GDP remains at $19.1 (trillion). What happens in the money market at the existing interest rate? ______ (shortage or surplus) of money by $ ______.
In: Economics
Tukey's Post test. Alpha = .05. Group I: 0, 2, 2, 0, 1 Group II: 4, 6, 1, 5, 4 Group III: 1, 3, 0, 1, 0. Step by Step how to solve
In: Math
use the following codes and change In the main-content div, for content, add three select dropdowns separated by line breaks. One will have ID changeFont, one will have ID bgColor and the third will have ID resizeDiv. For changeFont, the options should be: [CHANGE FONT SIZE] value blank, 8 pt. value 8t, 10 pt. value 10pt, 12 pt. value 12pt, 14 pt. value 14pt, and 16 pt. value 16pt. For bgColor the options should be [CHANGE BG COLOR] value blank, black value #00000, red value #ff0000, green value #00ff00, blue value #0000ff, white value #ffffff. For resizeDiv the options should be [RESIZE MAIN DIV] value blank, 150px value 150px, 250px value 250px, 350px value 350px, 450px value 450px, 550px value 550px, 650px value 650px.
3. Write three functions: changeFont(), changeBGColor(), and resizeDiv(). changeFont will change the font size of the main div based on what the user selects, or the default of 12pt if the user selects [CHANGE FONT SIZE]. changeBGColor will change the background color to the color selected, and ALSO set the font color to white if the selection is black, red, or blue, and font color will be black if white or green. The default for changeBGColor will be white with black font. resizeDiv will resize the main content div to the PX selected, or 85% if nothing is selected. HINT: onchange.
HTML
<head>
<!-- title for web page -->
<title>jen's CISS221 JavaScript Template</title>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<!-- <link> is used for external stylesheet -->
<link href="JStemplate.css" rel="stylesheet">
</head>
<body>
<div id="banner" class="banner">Mat's Javascript Template</div>
<div id="left-content" class="left-content">Left content</div>
<div id="main-content" class="main-content">This is Main are</div>
<div id="footer" class="footer">©2019 Mat cantor for CISS 221</div>
</body>
</html>
CSS
/* style rule for body */
body{
background-color: #66ff66;
}
/* style rule for banner */
#banner{
padding-top:20pt;
Padding-bottom:20pt;
color:#141414;
background-color:#cccc33;
text-align: center;
font-size: 18pt;
border: 2px solid green ;
padding: 20px;
}
/* style rule for left-content */
#left-content{
background-color: #000000 ;
text-align: center;
height: 45pt;
Width:50pt;
padding-top: 100pt;
color :#cccc33;
float:left;
border: 2px solid green ;
padding: 65px;
}
/* style rule for main-content */
#main-content{
background-color:#ffffff;
text-align: center;
padding-top:120pt;
Padding-bottom:10pt;
color :#cccc33;
border: 2px solid green;
}
/* style rule for footer */
#footer {
background-color: #cccc33;
text-align: center;
font-size: 8pt;
padding-top:10pt;
Padding-bottom:15pt;
border: 2px solid green ;
padding: 20px;
clear:both
}
In: Computer Science
how important is the development of adaptive communication skills for an infant
In: Psychology
Give the expected ground-state electron configurations for the following elements:
a) Ti
b) Ru
c) Sn
d) Sr
e) Se
Please explain this process as well, thank you!
In: Chemistry