XploRe is a combination of classical and modern statistical procedures. It is the basis for statistical analysis, research, and teaching. Its purpose lies in the exploration and analysis of data, as well as in the development of new techniques.
Now we want to see how its XploRe can be used as a statistical package to perform statistical analyses.
The Net Based Statistics exists. But it is inconvenient, because it will take long time to get response from the server. So we give it up and use the old version XploRe.
First, we must download XploRe package from the web.
These windows are:
We can open the editor-window in XploRe, and load the data from a file.
(1) Use READ to read the Numerical Data.
Now we will show you some simple examples using the data "pullover" within the XploRe datasets.
Example 1. How to read numerical data only(using build-in datasets "pullover")
Solution: copy the following program in the editor window:
x = read("pullover") //pullover is the file name of data x // if you want to list the data in the output window
(2). Use READM to read the Mixed Data that contains Numerical Data and Text Data.
Example 2: How to read mixed data (using user-entered datasets)
Now open the following file:
Let's open a new editor-window by clicking the program again. Since this data set includes both Numerical and Text Data, we use READM to read the mixed data set.
Then copy the following lines into a new editor area:
library("XploRe") x = readm("user") x
Click the Execute to get the output. In the output-window, 'x.type', 'x.double' and 'x.text' are shown. The original data set was divided into two parts. The numerical data are double type, and the character data are text type. The 'x.double' has 5 variables in order : nr, age, sibling, height, weight.
Let's pick the last four numerical variables as matrix y to compute the statistics using function mean and median. Copy the following lines into the editor-window.
y = x.double[ , 2:5] library("stats") mean(y) median(y) var(y)
We can also use the function summarize to obtain the statistical summary.
library("stats") summarize(y, "age"|"sibling"|"height"|"weight")
Now, let's plot histogram and boxplot, using the functions plothist and plotbox to plot the fourth column height. Note that Plothist and plotbox can only plot for data in one column. Copy the following short program in a new editor.
library("XploRe") x = readm("user") z = x.double[ , 4] library ("plot") plothist(z) plotbox(z)
Then click the Execute.
Exercise 1. Please write a program to plot the histogram and plotbox for age by yourselves.
Now, let's do the linear regression weight on age. First show the ANOVA table , and then plot the scatterplot and regression line. Copy the following program in a new editor-window.
library("XploRe") x = readm("user") y = x.double[ , 2|5] y1 = y[ , 1] y2 = y[ , 2] library("stats") {b, bse, bstan, bpval} = linreg(y1, y2) library("plot") plot(y) regy=grlinreg(y) plot(y, regy)
Exercise 2. Please write a program, to obtain the ANOVA table, and plot the regression line of height on age.
Homework: