Web system for detecting privacy policy violation terms You need to collect more than 30 good privacy policy that complaint with GDPR and compare user input with it to detect privacy policy likelihood of violations.We want to create a web system that user will enter any privacy policy terms as user input and the system will need to compare it with a set of data (document) that contains GDPR compliant Privacy policy and return a result of the likelihood of privacy policy violation or not depend on less similirty with GDPR complaint privacy policy document for example: user enter a privacy policy that will share user data with third party so it’s need to detect the violation ,using NLP python with flask framework using pythonanywhere Website name: Privacy Policy Detection System.Programming Language: Python using NLP.Framework: FlaskCloud Host: Pythonanywhere.The web system will contain of the system name “Privacy Policy Detection System.”will contain one text area where it will ask the user to “Enter the privacy policy:” and the user will paste any privacy policy User will click on the Check button.Data need to be clean before analyse it for example clean stop words, white space, tokenized… etc to accomplish this task.Output area for the result of the likelihood of privacy policy violation will appear to the user Design a good interface for the system we preferred to use a background related to security Please if you have any idea or recommendation for the system let us know Thank you
Detecting system
Anthem College Phoenix The Ford vs Wainwright Case Amendment Essay
Anthem College Phoenix The Ford vs Wainwright Case Amendment Essay.
Amendment VIII of the United States Constitution states, “Excessive
bail shall not be required, nor excessive fines imposed, nor cruel and
unusual punishments inflicted.” Unfortunately, the Amendment itself does
not give much deference to what exactly cruel and unusual punishment
is. We as a society pay close attention to cruel and unusual punishment
at the trial level, but what about once they are in jail/prison?
undefined
For this week’s assignment, you are going to research one way
correctional officers impose cruel and unusual punishment upon inmates
within jails and prisons. Once you have located an example of cruel and
unusual punishment, you will complete the following:
undefinedIn 50-100 words, summarize a hypothetical scenario involving the cruel and unusual punishment you researched.
Keep in mind, you are not the subordinate enforcing the cruel
and unusual punishment here; you will be in a role of leadership
addressing the cruel and unusual punishment. In 250 words or less, taking into consideration the different
actions you learned about when responding as an effective leader in this
week’s content, describe how you would address/respond to the unethical
situation.Lastly, in 50 words or less, detail what repercussions/consequences the officer would face for his actions.APA format grammar and punctuation, references and citations.
Anthem College Phoenix The Ford vs Wainwright Case Amendment Essay
Ashford University Manager of CTU Health Care Systems Paper
order essay cheap Ashford University Manager of CTU Health Care Systems Paper.
As the manager of CTU Health Care Systems, you have done your research on three vendors to which you would like to outsource the implementation of the electronic health records (EHRs) for the clinics. As the manager, you have a number of critical decisions regarding the electronic medical record systems. At first, you thought you could either implement the existing EHR system at the other acute care organization or implement an entirely new EHR in both facilities.You met with your staff, and after researching several companies that offered both products and services, you have solicited request for proposals (RFPs) from the following three companies:ABC Systems Consulting, the leading company in health care systems integration services, refused to bid on the systems integration required for bringing the current EHR system into the other organization. This was because of the risks and time requirements for designing, implementing, and testing the large number of interfaces required and the required time line for the completion of the project as identified by the client. XYZ EHR Systems proposed that its new, recently redeveloped EHR be implemented in both facilities, which included a computerized physician order entry (CPOE) module, standardized drug interaction alert functionality, and customizable clinical alert functionality. It estimated that the merged entity would get a much better price than $50 million for purchasing this new system. Unfortunately, XYZ was unable to provide evidence of successful installation of its recently redeveloped EHR system at a similarly large delivery network or anywhere. QRS EHR Systems, a leading provider of EHR systems for large acute care facilities, proposed that its EHR be installed in both acute care organizations with a $50–60 million price tag. QRS included a CPOE module, standardized drug interaction alert functionality, as well as evidence-based clinical alert functionality. QRS also had a physician office EHR system with an embedded patient registration system; however, QRS has had minimal experience with integrating the physician office registration system with the acute care (hospital) registration system—an integration feature that was a priority for this project based on the client’s information technology (IT) strategic plan. The stakes surrounding your recommendation to the chief information officer (CIO) and chief executive officer (CEO) could not be higher in terms of dollars and your career.Discuss the following in your paper of 3-4 pages, not including title page and reference page:What pieces of information are the most critical for your decision on selecting the right vendor? What other options, if any, do you have? What are the critical success factors in the case? What are your recommendations to the CIO and CEO based on the RFPs that you received?
Ashford University Manager of CTU Health Care Systems Paper
Love Canal and Saving the Turtles Research Paper
Environmental problems and threats are often cited as the most important and crucial issues for global and regional communities. Thus, companies and local authorities often forget about morality and ethics blinded by increased profits and enormous opportunities of new business ventures. Love Canal and population of turtles are not an exception: they became the greatest environmental tragedy unveiling low morals and lack of ethical principles of business. Ethical behavior, at its most basic level, is what most people in a given society or group view as being moral, good, or right. In general, moral responsibility involves strict guidelines which determine moral and social obligations the people should follow. Potential hazards or problems, both when used as intended and possible misuse or use in other applications, should be identified. The Love Canal was created and used by the Hooker Chemical Company for dumping hazardous wastes. In 1953, the canal was covered with earth and sold it to the city. The main problem was that the city authorities paid no attention to hazardous wastes and built 100 homes on the banks of this canal. In a short period if time, hazardous chemicals seeped through the ground. They were found everywhere in the playground and at homes, at school and hospitals1. The population of the Love Canal was several injured and poisoned by these chemicals. “Some of these puddles were in their yards, some were in their basements, others yet were on the school grounds. A large percentage of people in Love Canal are also being closely observed because of detected high white-blood-cell counts, a possible precursor of leukemia”2. Another tragedy affected the most unique and rare species of turtles, the Kemp Ridley sea turtles. In spite of protective laws and regulations, this population decreased each year of about 3 %. The main cause of extinction was shrimp industry and trawlers which ruined nests and killed turtles. In order to improve the situation, TED device (turtle exploder device) was developed. In a time, the research committee announced results: TED was ineffective and did not protect turtles from extinction. The developers of TED protected their device and claimed that shrimpers did not use it correctly. In their turn, shrimpers accused the federal government and TED laws in unfair policies which caused economic damage to the industry3. The ethical problem was that neither government nor shrimp industry wanted to protect the turtles and lost million of dollars. Shrimpers did not want to use innovative technology and reduce number of trawlers while the federal authorities did not spent money on research and development, and did not prohibit shrimp business in this region. Both of these cases unveil lack of ethical principles and neglect of moral norms in business and economic matters. Following utilitarianism and morality, any business should be based on the greatest happiness principle, the hedonistic principle and the principle of impartiality. In this case, happiness’ means the pleasure and absence of pain of sentient living beings4. The qualities of different kinds of pleasure and pain are irrelevant to the happiness calculation—the only variables to be considered are the intensity, duration, probability, closeness, continuity and purity of the pleasures and pains in question, and the number of individuals who experience them. In the happiness calculation, the pleasures and pains of each sentient living being shall be weighed equally. The first acknowledged proponent of radical utilitarianism was William Godwin, whose uncompromising applications of the utilitarian calculus gave the view the bad name it still has in many quarters5. Applied to “Love Canal” and “Save the Turtles” cases, utilitarianism can be seen as the application of the requirements of altruism and benevolence to reforms in legislation and in political life. The theoretical foundation of this doctrine varied from descriptive altruism to psychological egoism, but the central position is invariably occupied by the three principles mentioned above. In both cases, the aim of normative ethics is to provide a plausible and inclusive account of the rights and duties of moral agents and moral patients6. For the Love Canal, the moral principles involve fair treatment of all citizens and the environment in spite of economic benefits and opportunities. The case “Save the Turtles” shows that the basic needs of various individuals and groups may be in conflict, but the principles of utilitarianism is to define the rights and duties of the parties involved. The aim of normative ethics is to provide a plausible and inclusive account of the rights and duties of moral agents and moral patients7. Today, there is a strong tendency is for societies to demand that companies act with increasing concern for the overall societal and environmental needs, as well as economic needs. Moral responsibility of the government and the shrimp industry means that they have broader obligations including the community, environment, and society as a whole. For instance, safety is more important than the level of profits8. Many companies develop a code of ethical conduct which stipulates strict moral and ethical rules aimed to protect interest groups. The notion of responsibility involves external areas and internal areas (physical environment factors). The main task of moral responsibility and ethics is to reduce any harmful influence on the natural environment and stakeholders. Responsibility has a great impact on the overall being of a business determining moral and ethical standards applied to all areas of operations. It creates a positive image of the company and ensures social stability and recognition. More specifically, values should be seen as the standards of shrimp industry by which things may be judged and serve to shape people’s beliefs and consequently their attitudes. In both cases, the authorities did not interfere and protect the environment from degradation. This is probably the most illusive area of culture as values and attitudes only become apparent through inter-personal communication and interaction9. There are no formal rules and guidelines, but the unwritten frameworks may be just as powerful in determining behavior. The proponents of morality claim that it is futile to educate the masses, since ordinary human beings lack the inborn qualities without which it is impossible to appreciate the environment. Understanding moral action as adherence to pre-established rules encourages rigidity and lack of moral sensitivity. Understanding moral action as the development of a good character encourages the self-engrossed concern with meaning well or of having good intentions. Each of these two concerns provides a comfortable substitute for the difficult task of bringing about good consequences in specific situations10. In the case of Love Canal and Save the Turtles, morality is more than following rules and more than manifesting it set of inculcated virtues. In both cases, morality means environmental protection of the land and the species, moral social behavior and rules. Morality is not postulated in abstract rules to be followed or virtues to be inculcated; rather, morality is discovered in concrete moral experience. Bringing about good consequences in specific situations through moral decision making helps develop, as byproducts, both good character traits as habits of action and good rules11. Value emerges in the interactions of individuals, and wholes gain their value through the interactions of individuals, while the value of individuals cannot he understood in isolation from the interrelationships which constitute their ongoing development12. When the government slides over the complexities of a problem, it can be easily be convinced that categorical moral issues are at stake. And the complexities of a problem are always context dependent. Morality is not postulated in moral rules but discovered in moral experience functioning in the richness and complexity of situations, and it is here that the recovery of the “foundations” of morality is to be found. Lack of research and attention to environmental threats led to health risks and deaths near the Love canal. “The Hooker Chemical Company’s dumping of toxic wastes at Love Canal,” said Blum, “and the resulting health and environmental damages are a stark symbol of the problems created by the improper disposal of hazardous wastes by our society”13. In this case, morality is not ultimately guided by fixed ends; rather, such reasoning involves an ongoing process in which the means–end distinction becomes purely functional14. Get your 100% original paper on any topic done in as little as 3 hours Learn More Any chosen end is a means to something further, and any end chosen is value laden with the means with which it is intertwined. People create and use norms or ideals in the moral situation as hypotheses by which to organize and integrate the diversity of values. For shrimpers, profits and personal gain were the only ‘values’ they followed. In general, the moral realm is one of rich, complex situations, and what works is dependent upon the emergent but real domain of values that need integration and harmonizing. Workability cannot be understood in terms of one fixed end; rather, workability involves the flourishing of experience in its entirety15. It involves sensitivity to complex value-laden nature of a situation and its interwoven and conflicting dimensions, the ability to use creative intelligence geared to the fullness of the situation, and an ongoing evaluation of the resolution. Decisions that change a situation will give rise to new problems requiring new integrative solutions. The goal is not to determine the most unequivocal decision, but the richest existence for those involved16. While efficiency is certainly (or at least should be) a consideration in many public policy measures, it will in many cases be sacrificed in the interests of justice, equity, and fairness. Government moves forward by a complex process of compromise and negotiation and divides authority and applies checks and balances to limit power in a way that would not be possible for private business organizations to accomplish. In sum, the cases described above vividly portray that morality and utopianism can be discovered in primal moral experience, and the vital, growing sense of moral rightness comes from attunement to the way in which moral beliefs and practices must be rooted naturally in the very conditions of human existence. This attunement gives vitality to the diverse and changing principles embodied in ongoing moral activity; such an attunement also provides the ongoing direction for well-intentioned individuals to continually evaluate and at times reconstruct their own habits and traditions as they use the various human dimensions needed to bring about ongoing flourishing of experience in a changing world. Humans cannot assign priority to any one basic value, nor can their values be arranged in any rigid hierarchy, but they must live with the consequences of their actions within concrete situations in a process of change. Morality should support public policy; policy must be fed by moral perceptiveness. The state and government policies in turn should nurture moral sensitivity and the moral direction of market forces by providing a socioeconomic context in which morally attuned actions can flourish without undue economic penalty. The operating principles of the policy process are concepts such as justice, equity, and fairness. These concepts are often invoked to justify the decisions made in the public policy process about resource allocation. Footnotes Beck, E.C. The Love Canal Tragedy. EPA Journal, 1979. Ibid. Buchholz, R.A. Save the Turtles. Pollution and Environment. pp. 100-103. Frederick, R. (ed.). A companion to business Ethics. (Blackwell Publishers, 2002), 23. Ibid, 24. Ibid, 26. Ibid, 28. Beauchamp, T.L., Bowie, N. Ethical Theory and Business. 7th edition. (Upper Saddle River, New Jersy: Pearson Prentice Hall, 2003), 87. Ibid, 83. The Definition of Morality. The Stanford encyclopedia of Philosophy. 2002. Web. Ibid. Beauchamp, T.L., Bowie, N. Ethical Theory and Business. 7th edition. (Upper Saddle River, New Jersy: Pearson Prentice Hall, 2003), 87. EPA, New York State Announce Temporary Relocation of Love Canal Residents. EPA press release, 1980. Beauchamp, T.L., Bowie, N. Ethical Theory and Business. 7th edition. (Upper Saddle River, New Jersy: Pearson Prentice Hall, 2003), 89. Ibid, 89 Ibid. 90. Bibliography Beauchamp, T.L., Bowie, N. Ethical Theory and Business. 7th edition, Upper Saddle River, New Jersy: Pearson Prentice Hall, 2003. Beck, E.C. The Love Canal Tragedy. EPA Journal, 1979. Buchholz, R.A. Save the Turtles. Pollution and Environment. pp. 99-105. Frederick, R. (ed.). A companion to business Ethics. Blackwell Publishers, 2002. The Definition of Morality. The Stanford encyclopedia of Philosophy. 2002. Web. EPA, New York State Announce Temporary Relocation of Love Canal Residents. EPA press release, 1980. Web.
stats homework using R
stats homework using R. I’m stuck on a Statistics question and need an explanation.
#Name:
#Student ID:
rm(list=ls())
source(‘Rallfun-v33.txt’)
#PART 1
#A company claims that, when exposed to their toothpaste, 45% of all bacteria related to gingivitis are killed, on average. You run 10 tests and ???nd that the percentages of bacteria killed in each test was:
# 38%, 44%, 62%, 72%, 43%, 40%, 43%, 42%, 39%, 41%
# Assuming normality, you will test the hypothesis that the average percentage of bacteria killed was 45% at alpha=0.05.
#1.1) Write out the Null and Alternative hypotheses
#1.2) Calculate the T-statistic and use Method 1 (we saw in class) to determine if the average bacteria killed was 45%. Do it by “hand”.
#Hint: Method 1 is to compare T to a critical value “c”.
#1.3) Do you reject or fail to reject the null?
################################################
#PART 2
#Now, let’s not assume normality
#2.1) Using the same data as in Part 1, test the hypothesis that the 20% trimmed mean is 45%?
#2.2) Do you reject or fail to reject the null?
#2.3) Assuming your test in 2.1 is the truth, what type of error did you make in #1.3?
################################################
#PART 3
#In a study of court administration, the following times to disposition (in minutes) were determined for twenty cases and found to be:
# 42, 90, 84, 87, 116, 95, 86, 99, 93, 92, 121, 71, 66, 98, 79, 102, 60, 112, 105, 98
#Assuming normality, you will test the hypothesis that the average time to disposition was 99 minutes at alpha=0.05.
#3.1) Write out the Null and Alternative hypotheses
#3.2) Calculate the T-statistic and use Method 2 (we saw in class) to determine if the average time to disposition was 99? Do it by “hand”.
#Hint: Method 2 is to evaluate the confidence interval.
#3.3) Do you reject or fail to reject the null?
################################################
#PART 4
#Now, let’s not assume normality
#4.1) Using the same data as in Part 3, test the hypothesis that the 20% trimmed mean is 99?
#4.2) Do you reject or fail to reject the null?
#4.3) Assuming your test in 4.1 is the truth, what type of error did you make in #3.3?
################################################
#PART 5
#Suppose you run an experiment, and observe the following values:
# 12, 20, 34, 45, 34, 36, 37, 50, 11, 32, 29
#You will test the hypothesis that the average was 25 at alpha=0.05.
#5.1) Write out the Null and Alternative hypotheses. Conduct the hypothesis test assuming normality. Use the “t.test” function. Do you reject or fail to reject the null?
#5.2) Conduct the hypothesis test without assuming normality. Do you reject or fail to reject the null?
#5.3) Assuming the answer in #5.2 is the truth, what type of error (if any) did you make in #5.1 by assuming normality?
——————————————————————————————
Lab 7- Lecture Notes (FOR YOUR REFERENCE)
#Lab 7-Contents
#1. Formulating Hypotheses
#2. T-statistics by Hand
#3. Alpha Level
#4. Evaluating Our Results
#5. Using the t.test function
#6. T-tests with Trimmed Means (trimci function)
#7. Type 1 and Type 2 Errors
# Last week we talked about computations for when the Population
#Variance is known and unknown.
# Given that we rarely know the population variance,
#we will use the T-distribution for all of today’s lab.
#We will primarily work with the dataset brfss09_lab7.txt:
#########################################################################################################################
#Behavioral Risk Factors Surveilance Survey 2009 (BRFSS09) Data Dictionary:
#————————————————————————————————————————
#id: “Subject ID”Values[1,998]
#physhlth: “# Days past month phsycial health poor” Values[1,30]
#menthlth: “# Days past month mental health poor”Values[1,30]
#hlthplan: “Have healthcare coverage?”Values 1=Yes, 2=No
#age:”Age in Years”Values[18,99]
#sex:”Biologic Sex”Values 0=Female, 1=Male
#fruit_day: “# of servings of fruit per day”Values[0,20]
#alcgrp: “Alcohol Consumption Groups”Values 1=None, 2= 1-2 drinks/day 3= 3 or more drinks/day
#smoke:”Smoking Status”Values 0=Never, 1=Current EveryDay, 2=Current SomeDays, 3=Former
#bmi:”Body Mass Index”Values[14,70]
#mi:”Myocardial Infarction (heart attack)”Values 0=No, 1=Yes
#————————————————————————————————————————
# For today’s lab, let’s start by reading in our datafile
# ‘brfss09_lab7.txt’ into an object called mydata
mydata=read.table(‘brfss09_lab7.txt’, header=T)
#This file contains:
dim(mydata)#100 Subjects, 11 variables
#With the following variables:
names(mydata)
# We have collected this data and would like to know
#if the values we have found in our sample are different
#from the reported values in the literature.
# For example, it has been reported that the average BMI
# in the population is 27.5. We would like to know if the
#values in our sample are somehow different than this value.
#———————————————————————————
# 1. Formulating Hypotheses
#———————————————————————————
#Step 1 of determining if our BMI values differ from the
#national average of 27.5 is to formulate our hypotheses
#We have TWO hypotheses
#1) The Null Hypothesis: H0: mu = 27.5
#2) The Alternative Hypothesis: HA: mu != 27.5
#NOTE: mu=Population Mean
#The above hypotheses are Two-Sided.
#By this I mean that we are looking to see if our sample values of
#BMI are greater than (>) OR less than (<) 27.5.
# A one-sided hypothesis test would look like:
#H0: mu < 27.5
#HA: mu > 27.5
#OR
#H0: mu > 27.5
#HA: mu < 27.5
#We will always use two-sided tests in this class,
#and similarly in the real world two-sided tests dominate.
#Once we have our hypotheses we will evaluate them
#and determine one of two outcomes:
# A) Reject the Null Hypothesis
# B) Fail to Reject the Null Hypothesis
#———————————————————————————
# 2. T-statistics by Hand (well..with help from the computer)
#———————————————————————————
#Recall from the last lab, that the formula for a T-statistic is:
# T = (SampleMean – PopMean) / (SampleSD/sqrt(N))
#Another way to write this would be:
# T = (xbar – mu) / (s/sqrt(N))
#In this instance PopMean (mu) is the NULL hypothesis
#value we are testing against.
#We can solve for the other values that we don’t yet know:
mu=27.5
xbar=mean(mydata$bmi) #28.22
s=sd(mydata$bmi) #6.32
N=100
T = (xbar – mu) / (s/sqrt(N))
T #1.14
#We end up with a T value of ~ 1.14
#But how does this tell us if our mean is different from 27.5 ???!!!
#Before we move on, I want us to think about why we need
#to evaluate if our mean of 28.22 is different from 27.5.
#Certainly we can see that these are different numbers,
#so what are we really asking here?
#One way to think about it is that we are asking if our
#sample mean of 28.22 is different from 27.5 simply due to chance.
#Think of a coin tossing example:
#Your friend tosses a coin in the air and it lands on heads
#3 times in a row!
#While, kinda cool, seems like that is probably random chance.
#What about if it landed on heads 100 times in a row?!
#You would probably think she was cheating somehow!
#Though it is possible to have 100 heads in a row
#by chance alone, it is very unlikely
#The point at which we say that something is random vs not
#is determined by our alpha level.
#———————————————————————————
# 3. Alpha Level
#———————————————————————————
# The alpha level is determined a priori (a head of time)
#and used to set the threshold by which we consider something
#to be random chance
# A common alpha level is 0.05.
# We typically reject the null (think something is not chance)
#when the result we have (eg. 28.22) would only be
#that extreme < 5% of the time by chance.
#Recall from Lab 6, that we use the alpha level
#to help figure out critical values (c)
# c=qt(1-(alpha/2), df)
#———————————————————————————
# 4. Evaluating our Results
#———————————————————————————
# There are 3 ways to evaluate if our mean of 28.22
# is different from the null of 27.5
# All three ways will yield the same conclusion.
#1) Compare T to a critical value (c)
#2) Evaluate the Confidence interval
#3) Compare the p value to our alpha level
###########################################################
#1) Compare T to a critical value (c)
#In order to compute the critical value (c),
#we must know the alpha level.
#We will choose a value of 0.05 (which is standard)
alpha=0.05
df=100-1
c=qt(1-(alpha/2), df)
#We can then compare the abosulte value of T (|T|)
#to the critical value c
#A) If |T| > c, then Reject the Null Hypothesis
#B) If |T| < c, then Fail to Reject the Null Hypothesis
#Let’s look at T can c
abs(T)
c
#What decision do we make about the Null Hypothesis????
###########################################################
#2) Evaluate the Confidence interval
#Rather than compare T to c,
#we could instead compute the confidence interval.
#Recall the formula for the Confidence interval is:
#LB= xbar – c*(s/sqrt(N))
#UB= xbar + c*(s/sqrt(N))
LB = xbar – c*(s/sqrt(N))
UB= xbar + c*(s/sqrt(N))
#A) If mu is not within the Confidence Interval,
#then Reject the Null Hypothesis
#B) If mu is within the Confidence Interval,
#then Fail to Reject the Null Hypothesis
#Let’s look at LB and UB
LB
UB
mu
#What decision do we make about the Null Hypothesis????
###########################################################
#3) Compare the p value to our alpha level
#Lastly, we could find the probability value (or p-value)
#for the T statistic we created.
#We can do this by using the pt() function we learned
#about last week in lab 6.
#There is a forumla for computing P values from T-statitics:
# pval = 2*(1-pt(abs(T), df))
pval = 2*(1-pt(abs(T), df))
#We then compare the p-value to our alpha level
#A) If pval < alpha, then Reject the Null Hypothesis
#B) If pval > alpha, then Fail to Reject the Null Hypothesis
#Let’s look at our p-value.
pval
alpha
#What decision do we make about the Null Hypothesis????
#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#
#Exercise 4-1:
#Evaluate if the mean age from our sample (mydata) is different
#than the populatiuin mean age of 56
# A) Write down the Null and Alternative Hypotheses
# B) Calculate the T-statistic by hand
# C) Evaluate the Null hypothesis by using ALL 3 methods that
# we just discussed
# D) Based on the results in C, do you Reject or Fail to Reject
# the Null Hypothesis?
#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#
#A)
#B)
#C)
#Method 1: Compare T to a critical value (c)
#Method 2: Evaluate the Confidence interval
#Method 3: Compare the p value to our alpha level
#D)
#———————————————————————————
# 5. Using the t.test function
#———————————————————————————
#^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^#
# One Sample T-Test : t.test(data$variable, mu)
#^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^#
#It was really awesome that we figured out T by hand!
#And then figured out the confidence intervals and P values!
#From now on, let’s just use a program to do all this for us.
#The function t.test will presume an alpha level of 0.05 by default.
t.test(mydata$age, mu=56)
# t.test(mydata$bmi, mu=27.5)
#Much simpler!
#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#
#Exercise 5-1: Use the t.test function to evaluate if
#A) the mean days of physical health (physhlth) is different
# than the population mean of 10? Reject the Null?
#B) the mean fruits per day (fruit_day) is different than
# the populatiuin mean of 4? Reject the Null?
#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#
#A)
#B)
#———————————————————————————
# 6. T-test with Trimmed Means
#———————————————————————————
#To use the T-test with trimmed means,
#we will need to load in the source code ‘Rallfun-v33.txt’
#The trimmed mean T-test is beneficial in that it does not
#presume a perfect Normal Distribution
#^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^#
# Trimmed Mean T-Test:
# trimci(data$variable, tr=0.2, alpha=0.05, null.value=0)
#^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^#
#For example, if I wanted to test if the age was equal to 56
#using Trimmed Means I could do:
trimci(mydata$age, null.value=56)
#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#
#Exercise 6-1: Use the trimci function to evaluate if
#A) the 20% trimmed mean of days of physical health (physhlth) is
# different than the populatiuin mean of 10? Reject the Null?
#B) the 20% trimmed mean fruits per day (fruit_day) is different
#than the populatiuin mean of 4? Reject the Null?
#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#
#A)
#B)
#———————————————————————————
# 7. Type 1 and Type 2 Errors
#———————————————————————————
#Notice that we had very different answers to the same
#questions in Ex. 5-1 and 6-1
#Depending upon the method that we used.
#This brings us to discussing Type 1 and Type 2 Error
#A Type 1 error is when our test tells us to reject the null,
#but in truth we should not have
#A Type 2 error is when our test tells us to fail to reject the
#null, but in truth we should have rejected the null
#The following 2×2 square might make this easier to see.
# Truth
#————————————
#| H0 | HA |
#————– |——-|———–|
#My Test: H0 | H0 Type 2|
#————– |——-|———–|
#My Test: HA Type 1 | HA |
#————————————
#For the next exercise, let’s presume that our test of the trimmed mean is the Truth
#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#
#Exercise 7-1:
#A) What type of error did we make when evaluating the mean
#of physhlth in exercise 5-1?
#B) What type of error did we make when evaluating the mean
#of fruit_day in exercise 5-1?
#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#
#A)
#B)
stats homework using R