Assume you have arrived at the URL for Rweb. An easy way to do this is to use the Rweb link from our class web site.
All data sets in Rweb are either vectors or matrices. We will consider both types in this course. But for now we will just be considering vectors. We began by entering some data.
Note here we have created a vector w1
of length 3 and then changed its
last value from 4 to 5. Next we created w2 by
adding 4 to each value of w1.
Then we created v by combing the two and finally we wrote out
v.
By clicking on the submit button you can do this yourself.
Rather than entering a data vector at the beginning of each session it is often more convenient to enter the data in a file somewhere else and just call for it to be entered when you need it. This is done by entering the URL of the data in the single line window labeled { Dataset URL} just under the main session window.
When data is entered this way (either as a vector or a matrix) Rweb
always assigns it to X. So in the above example
the data in example1 was a vector of length 23 and we printed
out the values and then calculated their sum.
The sum function
(
on-line help) calculates the sum of a vector. You can
click on on-line help to find out more about how it works.
We then calculated several statistics for the sample.
Note for this example the URL was
http://www.stat.umn.edu/~glen/HW5021/example1.txt
For several of the homework assignments we have put data in files. It will save you time if you call them rather than enter the data yourself. All have the same URL's except the last bit which in this case is example1.txt.
As a finally example we will generate a random sample of 100 from a normal population with mean 50 and standard deviation 10. Then we find the mean of the sample and construct its histogram.
To learn more about the rnorm function click on
(
on-line help)