If you are worried about completing your R homework, you can connect with us at Statisticshomeworkhelper.com. We have a team of experts who are professionals in R programming homework help and have years of experience in working on any problem related to R. Visit statisticshomeworkhelper.com or email info@statisticshomeworkhelper.com. You can also call +1 (315) 557-6473 for assistance with Statistics Homework.
As part of the GSP’s capacity development and improvement programme, FAO/GSP have organised a one week training in Izmir, Turkey. The main goal of the training was to increase the capacity of Turkey on digital soil mapping, new approaches on data collection, data processing and modelling of soil organic carbon. This 5 day training is titled ‘’Training on Digital Soil Organic Carbon Mapping’’ was held in IARTC - International Agricultural Research and Education Center in Menemen, Izmir on 20-25 August, 2017.
As part of the GSP’s capacity development and improvement programme, FAO/GSP have organised a one week training in Izmir, Turkey. The main goal of the training was to increase the capacity of Turkey on digital soil mapping, new approaches on data collection, data processing and modelling of soil organic carbon. This 5 day training is titled ‘’Training on Digital Soil Organic Carbon Mapping’’ was held in IARTC - International Agricultural Research and Education Center in Menemen, Izmir on 20-25 August, 2017.
As part of the GSP’s capacity development and improvement programme, FAO/GSP have organised a one week training in Izmir, Turkey. The main goal of the training was to increase the capacity of Turkey on digital soil mapping, new approaches on data collection, data processing and modelling of soil organic carbon. This 5 day training is titled ‘’Training on Digital Soil Organic Carbon Mapping’’ was held in IARTC - International Agricultural Research and Education Center in Menemen, Izmir on 20-25 August, 2017.
Struggling with stats homework? Say no more! 📚 Our experts at StatisticsHomeworkHelper.com have curated the "Best 10 Tips to Solve Statistics Homework" just for you.
🔥 From probability hiccups to data dilemmas, our tips will guide you through. 🎯 No more stressing, just A+ grades and confidence to spare.
📌 What's in Store:
✅ Expert Techniques: Learn from the pros.
✅ 24/7 Availability: We match your schedule.
✅ Step-by-Step: Clear, concise problem-solving.
✅ Boosted Performance: Watch your grades rise.
🔗 Visit StatisticsHomeworkHelper.com and breeze through your stats assignments! 🌟
Are complex statistics problems leaving you puzzled? Look no further! Introducing StatisticsHomeworkHelper.com, your ultimate destination for conquering statistics challenges with ease.
🔍 Unparalleled Expertise: Our team of experienced statisticians is ready to tackle any problem thrown their way. From basic concepts to advanced analyses, we've got you covered.
📈 Step-by-Step Guidance: Say goodbye to confusion! Our detailed solutions break down even the trickiest questions into manageable steps, helping you grasp the concepts along the way.
⏱️ Time-Saving Assistance: Don't waste hours struggling over a single problem. Our efficient solutions give you more time to focus on other important tasks.
🌐 Anytime, Anywhere: Access our platform 24/7 from the comfort of your home. Whether it's a late-night study session or a last-minute assignment, we're always here to help.
🎓 Excelling Made Easy: Boost your grades and gain a deeper understanding of statistics. With StatisticsHomeworkHelper.com, excelling in your studies has never been more achievable.
🚀 Try Us Today: Visit our website and experience the power of a dedicated statistics homework solver. Let's turn those daunting problems into confident victories!
📢 Spread the word and tag friends who could use a statistics study companion. Together, let's conquer statistics! 📊📚
Get ready to unravel the mysteries of statistics with ease. Visit us at StatisticsHomeworkHelper.com and never fear your homework again! 🎉
As part of the GSP’s capacity development and improvement programme, FAO/GSP have organised a one week training in Izmir, Turkey. The main goal of the training was to increase the capacity of Turkey on digital soil mapping, new approaches on data collection, data processing and modelling of soil organic carbon. This 5 day training is titled ‘’Training on Digital Soil Organic Carbon Mapping’’ was held in IARTC - International Agricultural Research and Education Center in Menemen, Izmir on 20-25 August, 2017.
Struggling with stats homework? Say no more! 📚 Our experts at StatisticsHomeworkHelper.com have curated the "Best 10 Tips to Solve Statistics Homework" just for you.
🔥 From probability hiccups to data dilemmas, our tips will guide you through. 🎯 No more stressing, just A+ grades and confidence to spare.
📌 What's in Store:
✅ Expert Techniques: Learn from the pros.
✅ 24/7 Availability: We match your schedule.
✅ Step-by-Step: Clear, concise problem-solving.
✅ Boosted Performance: Watch your grades rise.
🔗 Visit StatisticsHomeworkHelper.com and breeze through your stats assignments! 🌟
Are complex statistics problems leaving you puzzled? Look no further! Introducing StatisticsHomeworkHelper.com, your ultimate destination for conquering statistics challenges with ease.
🔍 Unparalleled Expertise: Our team of experienced statisticians is ready to tackle any problem thrown their way. From basic concepts to advanced analyses, we've got you covered.
📈 Step-by-Step Guidance: Say goodbye to confusion! Our detailed solutions break down even the trickiest questions into manageable steps, helping you grasp the concepts along the way.
⏱️ Time-Saving Assistance: Don't waste hours struggling over a single problem. Our efficient solutions give you more time to focus on other important tasks.
🌐 Anytime, Anywhere: Access our platform 24/7 from the comfort of your home. Whether it's a late-night study session or a last-minute assignment, we're always here to help.
🎓 Excelling Made Easy: Boost your grades and gain a deeper understanding of statistics. With StatisticsHomeworkHelper.com, excelling in your studies has never been more achievable.
🚀 Try Us Today: Visit our website and experience the power of a dedicated statistics homework solver. Let's turn those daunting problems into confident victories!
📢 Spread the word and tag friends who could use a statistics study companion. Together, let's conquer statistics! 📊📚
Get ready to unravel the mysteries of statistics with ease. Visit us at StatisticsHomeworkHelper.com and never fear your homework again! 🎉
At our company, we understand that statistics homework help can be a challenging subject, and we are here to help. Whether you are struggling with probability or any other aspect of statistics, our experienced tutors are ready to guide you through the material and help you to achieve your academic goals. Contact us today to learn more about our statistics homework help services.
Visit statisticshomeworkhelper.com or email info@statisticshomeworkhelper.com. You can also call +1 (315) 557-6473 for assistance with Statistics Homework.
if you are struggling with your Multiple Linear Regression homework, do not hesitate to seek help from our statistics homework help experts. We are here to guide you through the process and ensure that you understand the concept and the steps involved in performing the analysis. Contact us today and let us help you ace your Multiple Linear Regression homework!
Visit statisticshomeworkhelper.com or email info@statisticshomeworkhelper.com. You can also call +1 (315) 557-6473 for assistance with Statistics Homework.
We understand that you're a college student and finances can be tight. That's why we offer affordable pricing for our online statistics homework help. Your future is important to us, and we want to make sure you can achieve your degree without added financial stress. Seeking assistance with statistics homework should be simple and stress-free, and that's why we provide solutions starting from a reasonable price.
Visit statisticshomeworkhelper.com or email info@statisticshomeworkhelper.com. You can also call +1 (315) 557-6473 for assistance with Statistics Homework.
Our experienced statistics help provider tutors offer support to complete your SAS homework help without any hassle. They are careful with your SAS homework and give 100% unique, well-researched, and authentic content. We have the best answers to do your SAS homework help. Because our statistics experts have plenty of years of experience in statistics, they also have excellent command over various statistics tools. They are having the best solution for your SAS homework .
Statistics is a subject that requires a lot of practice and understanding. However, students often find it challenging due to the complexity of the concepts. If you're one of them, don't worry. Our statistics homework helper assistance to students struggling with their assignments. Our team of experienced tutors uses a step-by-step approach to explain complex concepts and help you solve problems with ease. With our help, you can submit your assignments on time and improve your grades. Contact us today and get the best statistics homework help online. For more information Visit us at statisticshomeworkhelper.com or email info@statisticshomeworkhelper.com. You can also call +1 (315) 557-6473 for assistance with Statistics Homework.
Statistics is a subject that is essential for many fields, including business, science, and social science. However, it can be challenging for students to understand complex concepts and apply them in their assignments. If you're struggling with statistics homework, our team of experts is here to help you. We provide customized statistics homework help to students worldwide, ensuring that you understand the concepts and excel in your studies. Contact us today and get the best statistics homework help online. Visit us at statisticshomeworkhelper.com or email info@statisticshomeworkhelper.com. You can also call +1 (315) 557-6473 for assistance with Statistics Homework.
You can hire someone to do your statistics homework for you by using online statistics homework helper services. Hire/Pay an expert to do your statistics homework for you! Online on a website or Offline, we can do both! With grade guarantees. Get Statistics Homework Help with Step-by-Step Solutions from the best experts. Our company is available 24/7. Visit statisticshomeworkhelper.com or email info@statisticshomeworkhelper.com. You can also call +1 (315) 557-6473 for assistance with Statistics Homework.
At our statistics company, we are committed to delivering on-time statistics homework solutions. Statistics experts write your statistics homework professionally. We understand that deadlines are critical, and we strive to deliver our solutions within the timeframe. Our team is available 24/7 to provide support, answer questions, and offer guidance throughout the entire process. Visit statisticshomeworkhelper.com or email info@statisticshomeworkhelper.com. You can also call +1 (315) 557-6473 for assistance with Statistics Homework.
I am Edward Black. I am a Quantitative Research Homework Help Expert at statisticshomeworkhelper.com. I hold a PhD. in Statistics, from the University of Oxford, United Kingdom. I have been helping students with their statistics homework for the past 12 years. I solve assignments related to Statistics. You can see the sample on Quantitative Research for reference. Visit statisticshomeworkhelper.com or email info@statisticshomeworkhelper.com. You can also call +1 (315) 557-6473 for assistance with Statistics Homework.
I am Stacy W. I am a Probability Homework Expert at statisticshomeworkhelper.com. I hold a Masters in Statistics from, the University of McGill, Canada
I have been helping students with their homework for the past 8 years. I solve assignments related to Probability.
Visit statisticshomeworkhelper.com or email info@statisticshomeworkhelper.com. You can also call +1 (315) 557-6473 for assistance with Statistics Assignments.
My name is Marcos Tracy. I am associated with statisticshomeworkhelper.com for the past 9 years and have been helping students with their Statistics homework.
I have a master's in Professional Statistics from Harvard University.
Statistics is a branch of mathematics that deals with the collection, analysis, interpretation, presentation, and organization of data. It plays a crucial role in many fields, including business, economics, psychology, and biology, to mention a few. Statistics homework can be challenging for students, which is why many turn to online resources for help. Our goal is to provide reliable and comprehensive statistics homework help to students struggling with their assignments. Whether you need assistance with a specific problem or an entire project, our team of experienced tutors is here to support you. For more information visit us at https://www.statisticshomeworkhelper.com
✅ Lifetime access to statistical software and tools for enhanced learning.
✅ In-demand statistical analysis techniques for data professionals.
✅ Limitless learning opportunities in statistical modeling and data analysis.
✅ Cost-effective statistical training for students and professionals.
Visit us at👉 https://bit.ly/3PQTGIJ
I am William Butler. Currently associated with statisticshomeworkhelper.com as an assignment helper. After completing my master's from the University of British Columbia, I was in search of an opportunity that would expand my area of knowledge hence I decided to help students with their multivariate and monova assignments. I have written several assignments to help students overcome the statistics difficulties they face in multivariate and monova assignments.
Statistics provides an extensive range of concepts and introduction to the subject, which includes all the questions in the chapter provided in the syllabus. It is a section of mathematics that manages the collection, interpretation, analysis, and presentation of numerical data. In other words, statistics is a collection of quantitative data.
The rationale of statistics is to accord sets of information to be contrasted so that the analysts can focus on the sequential differences and trends. Analysts examine the data in order to reach the inferences concerning its meaning.
Given below are some important MCQs on statistics to analyses your understanding of the topic. The answers are also given for your reference.
My name is Moses Alex. I am associated with statisticshomeworkhelper.com for the past 15 years and have been assisting the statistics students with their homework.
I have a Masters in Statistics from Leeds Trinity University.
I am Hannah Lucy. Currently associated with statisticshomeworkhelper.com as statistics homework helper. After completing my master's from Kean University, USA, I was in search of an opportunity that expands my area of knowledge hence I decided to help students with their homework. I have written several statistics homework till date to help students overcome numerous difficulties they face.
I am Cecily, K.I am a Quantitative Methods Assignment Expert at statisticshomeworkhelper.com. I hold a Master's in Statistics, from Adelaide, Australia. I have been helping students with their assignments for the past 9 years. I solved Assignments related to Quantitative Methods.
Visit statisticshomeworkhelper.com or email info@statisticshomeworkhelper.com.You can also call on +1 678 648 4277 for any assistance with Quantitative Methods Assignment.
Honest Reviews of Tim Han LMA Course Program.pptxtimhan337
Personal development courses are widely available today, with each one promising life-changing outcomes. Tim Han’s Life Mastery Achievers (LMA) Course has drawn a lot of interest. In addition to offering my frank assessment of Success Insider’s LMA Course, this piece examines the course’s effects via a variety of Tim Han LMA course reviews and Success Insider comments.
Introduction to AI for Nonprofits with Tapp NetworkTechSoup
Dive into the world of AI! Experts Jon Hill and Tareq Monaur will guide you through AI's role in enhancing nonprofit websites and basic marketing strategies, making it easy to understand and apply.
Palestine last event orientationfvgnh .pptxRaedMohamed3
An EFL lesson about the current events in Palestine. It is intended to be for intermediate students who wish to increase their listening skills through a short lesson in power point.
Unit 8 - Information and Communication Technology (Paper I).pdfThiyagu K
This slides describes the basic concepts of ICT, basics of Email, Emerging Technology and Digital Initiatives in Education. This presentations aligns with the UGC Paper I syllabus.
Operation “Blue Star” is the only event in the history of Independent India where the state went into war with its own people. Even after about 40 years it is not clear if it was culmination of states anger over people of the region, a political game of power or start of dictatorial chapter in the democratic setup.
The people of Punjab felt alienated from main stream due to denial of their just demands during a long democratic struggle since independence. As it happen all over the word, it led to militant struggle with great loss of lives of military, police and civilian personnel. Killing of Indira Gandhi and massacre of innocent Sikhs in Delhi and other India cities was also associated with this movement.
How to Make a Field invisible in Odoo 17Celine George
It is possible to hide or invisible some fields in odoo. Commonly using “invisible” attribute in the field definition to invisible the fields. This slide will show how to make a field invisible in odoo 17.
Macroeconomics- Movie Location
This will be used as part of your Personal Professional Portfolio once graded.
Objective:
Prepare a presentation or a paper using research, basic comparative analysis, data organization and application of economic information. You will make an informed assessment of an economic climate outside of the United States to accomplish an entertainment industry objective.
Welcome to TechSoup New Member Orientation and Q&A (May 2024).pdfTechSoup
In this webinar you will learn how your organization can access TechSoup's wide variety of product discount and donation programs. From hardware to software, we'll give you a tour of the tools available to help your nonprofit with productivity, collaboration, financial management, donor tracking, security, and more.
Instructions for Submissions thorugh G- Classroom.pptxJheel Barad
This presentation provides a briefing on how to upload submissions and documents in Google Classroom. It was prepared as part of an orientation for new Sainik School in-service teacher trainees. As a training officer, my goal is to ensure that you are comfortable and proficient with this essential tool for managing assignments and fostering student engagement.
1.4 modern child centered education - mahatma gandhi-2.pptx
R Programming Homework Help
1. Problem 1: Use R as a calculator to compute the following values. After you do so, cut and
paste your input and output from R to Word. Add numbering in Word to identify each
part of each problem. (Do this for every problem from now on.)
(a) 27(38-17)
(b) ln(147
)
(c)
12
436
2. Vectors
Vectors may be created using the c command, separating your elements with commas.
> a <- c(1, 7, 32, 16)
> a
[1] 1 7 32 16
Sequences of integers may be created using a colon (:).
> b <- 1:10
> b
[1] 1 2 3 4 5 6 7 8 9 10
> c <- 20:15
> c
[1] 20 19 18 17 16 15
Other regular vectors may be created using the seq (sequence) and rep (repeat) commands.
> d <- seq(1, 5, by=0.5)
> d
[1] 1.0 1.5 2.0 2.5 3.0 3.5 4.0 4.5 5.0
> e <- seq(0, 10, length=5)
> e
[1] 0.0 2.5 5.0 7.5 10.0
> f <- rep(0, 5)
> f
[1] 0 0 0 0 0
> g <- rep(1:3, 4)
> g
[1] 1 2 3 1 2 3 1 2 3 1 2 3
> h <- rep(4:6, 1:3)
> h
[1] 4 5 5 6 6 6
2. Random vectors can be created with a set of functions that start with r, such as rnorm (normal) or
runif (uniform).
> x <- rnorm(5) # Standard normal random variables
> x
[1] -1.4086632 0.3085322 0.3081487 0.2317044 -0.6424644
> y <- rnorm(7, 10, 3) # Normal r.v.s with mu = 10, sigma = 3
> y
[1] 10.407509 13.000935 8.438786 8.892890 12.022136 9.817101 9.330355
> z <- runif(10) # Uniform(0, 1) random variables
> z
[1] 0.925665659 0.786650785 0.417698083 0.619715904 0.768478685 0.676038428
[7] 0.050055548 0.727041628 0.008758944 0.956625536
If a vector is passed to an arithmetic calculation, it will be computed element-by-element.
> c(1, 2, 3) + c(4, 5, 6)
[1] 5 7 9
If the vectors involved are of different lengths, the shorter one will be repeated until it is the
same length as the longer.
> c(1, 2, 3, 4) + c(10, 20)
[1] 11 22 13 24
> c(1, 2, 3) + c(10, 20)
[1] 11 22 13
Warning message:
longer object length
is not a multiple of shorter object length in: c(1, 2, 3) + c(10, 20)
Basic mathematical functions will apply element-by-element.
> sqrt(c(100, 225, 400))
[1] 10 15 20
To select subsets of a vector, use square brackets ([ ]).
> d
[1] 1.0 1.5 2.0 2.5 3.0 3.5 4.0 4.5 5.0
> d[3]
[1] 2
> d[5:7]
[1] 3.0 3.5 4.0
A logical vector in the brackets will return the TRUE elements.
> d > 2.8
[1] FALSE FALSE FALSE FALSE TRUE TRUE TRUE TRUE TRUE
> d[d > 2.8]
[1] 3.0 3.5 4.0 4.5 5.0
3. The number of elements in a vector can be found with the length command.
> length(d)
[1] 9
> length(d[d > 2.8])
[1] 5
Problem 2: Create the following vectors in R.
a = (5, 10, 15, 20, ..., 160)
b = (87, 86, 85, ..., 56)
Use vector arithmetic to multiply these vectors and call the result d. Select subsets of d to
identify the following.
(a) What are the 19th
, 20th
, and 21st
elements of d?
(b) What are all of the elements of d which are less than 2000?
(c) How many elements of d are greater than 6000?
3. Simple statistics
There are a variety of mathematical and statistical summaries which can be computed from a
vector.
> 1:4
[1] 1 2 3 4
> sum(1:4)
[1] 10
> prod(1:4) # product
[1] 24
> max(1:10)
[1] 10
> min(1:10)
[1] 1
> range(1:10)
[1] 1 10
> X <- rnorm(10)
> X
[1] 0.2993040 -1.1337012 -0.9095197 -0.7406619 -1.1783715 0.7052832
[7] 0.4288495 -0.8321391 1.1202479 -0.9507774
> mean(X)
[1] -0.3191486
> sort(X)
[1] -1.1783715 -1.1337012 -0.9507774 -0.9095197 -0.8321391 -0.7406619
[7] 0.2993040 0.4288495 0.7052832 1.1202479
> median(X)
4. [1] -0.7864005
> var(X)
[1] 0.739266
> sd(X)
[1] 0.8598058
Problem 3: Using d from problem 2, use R to compute the following statistics of d:
(a) sum
(b) median
(c) standard deviation
4. Matrices
Matrices can be created with the matrix command, specifying all elements (column-by-column)
as well as the number of rows and number of columns.
> A <- matrix(1:12, nr=3, nc=4)
> A
[,1] [,2] [,3] [,4]
[1,] 1 4 7 10
[2,] 2 5 8 11
[3,] 3 6 9 12
You may also specify the rows (or columns) as vectors, and then combine them into a matrix
using the rbind (cbind) command.
> a <- c(1,2,3)
> a
[1] 1 2 3
> b <- c(10, 20, 30)
> b
[1] 10 20 30
> c <- c(100, 200, 300)
> c
[1] 100 200 300
> d <- c(1000, 2000, 3000)
> d
[1] 1000 2000 3000
> B <- rbind(a, b, c, d)
> B
[,1] [,2] [,3]
a 1 2 3
b 10 20 30
c 100 200 300
5. d 1000 2000 3000
> C <- cbind(a, b, c, d)
> C
a b c d
[1,] 1 10 100 1000
[2,] 2 20 200 2000
[3,] 3 30 300 3000
To select a subset of a matrix, use the square brackets and specify rows before the comma, and
columns after.
> C[1:2,]
a b c d
[1,] 1 10 100 1000
[2,] 2 20 200 2000
> C[,c(1,3)]
a c
[1,] 1 100
[2,] 2 200
[3,] 3 300
> C[1:2,c(1,3)]
a c
[1,] 1 100
[2,] 2 200
Matrix multiplication is performed with the operator %*%. Remember that order matters!
> B%*%C
a b c d
a 14 140 1400 1.4e+04
b 140 1400 14000 1.4e+05
c 1400 14000 140000 1.4e+06
d 14000 140000 1400000 1.4e+07
> C%*%B
[,1] [,2] [,3]
[1,] 1010101 2020202 3030303
[2,] 2020202 4040404 6060606
[3,] 3030303 6060606 9090909
You may apply a summary function to the rows or columns of a matrix using the apply function.
> C
a b c d
[1,] 1 10 100 1000
[2,] 2 20 200 2000
[3,] 3 30 300 3000
6. > sum(C)
[1] 6666
> apply(C, 1, sum) # sums of rows
[1] 1111 2222 3333
> apply(C, 2, sum) # sums of columns
a b c d
6 60 600 6000
Problem 4: Use R to create the following two matrices and do the indicated matrix
multiplication.
21
14
9
3
20
13
8
2
19
12
7
1
13
4
2
12
9
7
What is the resulting matrix?
4.5 Mixed modes and data frames
All elements of a matrix must be the same mode (numeric, character, logical, etc.). If you try to
put different modes in a matrix, all elements will be coerced to the most general – usually
character.
> Name <- c("Bob", "Bill", "Betty")
> Test1 <- c(80, 95, 92)
> Test2 <- c(40, 87, 90)
> grades <- cbind(Name, Test1, Test2)
> grades
Name Test1 Test2
[1,] "Bob" "80" "40"
[2,] "Bill" "95" "87"
[3,] "Betty" "92" "90"
The solution is another complex object called a data frame. The data frame views rows as cases
and columns as variables. All elements in a column must be the same mode, but different
columns may be different modes.
> grades.df <- data.frame(Name, Test1, Test2)
> grades.df
Name Test1 Test2
1 Bob 80 40
2 Bill 95 87
3 Betty 92 90
Summary functions applied to a data frame will be applied to each column.
> mean(grades.df)
Name Test1 Test2
NA 89.00000 72.33333
Warning message:
argument is not numeric or logical: returning NA in: mean.default(X[[1]], ...)
7. > mean(grades.df[,2:3])
Test1 Test2
89.00000 72.33333
Note: as similar as matrices and data frames appear, R considers them to be quite different.
Many functions will work on one or the other, but not both. You can convert from one to the
other using as.matrix or as.data.frame.
> C.df <- data.frame(a,b,c,d)
> C.df
a b c d
1 1 10 100 1000
2 2 20 200 2000
3 3 30 300 3000
> C.df%*%B
Error in C.df %*% B : requires numeric matrix/vector arguments
> as.matrix(C.df)%*%B
[,1] [,2] [,3]
1 1010101 2020202 3030303
2 2020202 4040404 6060606
3 3030303 6060606 9090909
> C
a b c d
[1,] 1 10 100 1000
[2,] 2 20 200 2000
[3,] 3 30 300 3000
> mean(C)
[1] 555.5
> mean(as.data.frame(C))
a b c d
2 20 200 2000
5. Data Import – Text Files
Data files should most easily be set up as text files with rows as cases and columns as variables.
Datasets for this course will be found in this format on the course web site. Save them to a text
file and use read.table to read them into R as data frames.
This will require a complete path to the file's location. The easiest way to find this is to select
"Source R Code" from the file menu in R and browse to the desired file. You will get an error
message, but use the up arrow or cut and paste to change the source command to read.table.
> iris<-read.table("C:...Iris.txt",header=T)
> iris
Species SepalLength SepalWidth PetalLength PetalWidth
1 1 5.1 3.5 1.4 0.2
2 1 4.9 3.0 1.4 0.2
3 1 4.7 3.2 1.3 0.2
4 1 4.6 3.1 1.5 0.2
8. 5 1 5.0 3.6 1.4 0.2
6 1 5.4 3.9 1.7 0.4
: : : : : :
: : : : : :
: : : : : :
149 3 6.2 3.4 5.4 2.3
150 3 5.9 3.0 5.1 1.8
> mean(iris)
Species SepalLength SepalWidth PetalLength PetalWidth
2.000000 5.843333 3.057333 3.758000 1.199333
Other possible file format includes:
>iris<-read.table("C:Teaching_Advisingsta519---Multivariate
Statistics08 SpringDataIRIS.csv",header=T,sep=",”)
Or in a handy manner:
> iris=read.table('clipboard') # Copy and paste
Problem 5: The dataset RADIOLOGY may be found on the web page. This dataset (from
problem 3.5 in your book), contains hospital information for 31 months: visits to radiology,
patient-days, ER visits, and clinic visits. Save this file and use read.table to import it into
R.
What are the means and standard deviations of the four data variables (excluding month)?
6. Graphics
R has functions to automatically plot many standard statistical graphics. Histograms and
boxplots may be generated with hist and boxplot, respectively.
Once you have a graphic you're happy with, you can copy the entire thing. Make sure that the
graphics window is the active (selected) window, and select "Copy to clipboard as bitmap" from
the file menu. You can then paste your figure into Word and resize to taste.
> hist(iris$PetalLength)
>
> hist(iris[,4])# alternative specification
9. > boxplot(iris$PetalLength)
> boxplot(PetalLength~Species, data=iris) # Formula description,
# side-by-side boxplots
Problem 6: From the radiology data, examine the histograms and boxplots of clinic visits
and radiology visits. (Note: these will be two separate boxplots, not a single side-by-side
boxplot as above.)
10. 7. Scatterplots and simple linear regression
Scatterplots may be produced by using the plot command. For separate vectors, the form is
plot(x, y). For columns in a dataframe, the form is plot(yvar ~ xvar, data=dataframe).
> plot(iris$PetalLength, iris$PetalWidth)
> plot(PetalWidth~PetalLength, data=iris)
Linear regression is done with the lm command, with a form similar to the second version of the
scatterplot command.
> PetalReg <- lm(PetalWidth~PetalLength, data=iris)
> summary(PetalReg)
Call:
lm(formula = PetalWidth ~ PetalLength, data = iris)
Residuals:
Min 1Q Median 3Q Max
-0.56515 -0.12358 -0.01898 0.13288 0.64272
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) -0.363076 0.039762 -9.131 4.7e-16 ***
PetalLength 0.415755 0.009582 43.387 < 2e-16 ***
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 0.2065 on 148 degrees of freedom
Multiple R-Squared: 0.9271, Adjusted R-squared: 0.9266
F-statistic: 1882 on 1 and 148 DF, p-value: < 2.2e-16
> abline(PetalReg) # add the regression line to the plot
11. Problem 7: From the radiology data, construct a scatterplot of clinic visits (x) versus
radiology visits (y). Perform the simple linear regression of radiology visits on clinic visits
and add the regression line to the plot. Briefly comment on the fit.
Check out some misc R commands (always use bold Courier New font for your R
commands in your homework) like:
> ls.str(); ls.str; ?ls.str
> ls()
> getwd()
> setwd()
> dir()
> search()
> searchpaths()
> attach()
> detach()
> history()
> save.history()
> save.image()
> demo()
> demo(package = .packages(all.available = TRUE))
> help.search()
> help.search("linear models")
> help.search(keyword = "hplot")
> help(library=car)
> library()
> demo()
> demo(package = .packages(all.available = TRUE))
In addition to the standard packages listed in the search,
> search()
12. ".GlobalEnv" "package:stats" "package:graphics"
"package:grDevices" "package:utils" "package:datasets"
"package:methods" "Autoloads" "package:base"
you also need the following for this course:
graphics
lattice
scatterplot3d
rgl
MASS
cluster
sem
rpart
randomForest
TeachingDemos
ellipse
kohonen
mclust
mvtnorm
mvtnormpcs
neural
tree
mva
graphics
lattice
scatterplot3d
amap
AMORE
ade4
nnet
car
ca
vcd