teaching statistics interactively with geogebra and ruser-2013/slides/195.pdf · geogebra and r...
TRANSCRIPT
Teaching statistics interactively with Geogebra and R
V. Gómez Rubio, M.J. Haro Delicado, F. Parreño Torres
Departamento de MatemáticasCampus de Albacete
Universidad de Castilla-La Mancha
useR! 2013Albacete, 10-12 July 2013
V. Gómez Rubio et al. (UCLM) Geogebra and R 1 / 12
R software for statistical computing
Geogebra is a free software for dynamic geometryGeogebra is widely used to teach Mathematics at the high school anduniversity levelsWith Geogebra, students can create and manipulate geometricalobjectsWe use R for teaching Statistics in the Degrees of Computer Scienceand Industrial EngineeringHow can we use a more intuitive and dynamic environment toteach Probability and Statistics?
V. Gómez Rubio et al. (UCLM) Geogebra and R 2 / 12
Geogebra and R
Geogebra 5.0 and the Python WindowFrom version 5.0, Geogebra will be able to run small Python scriptsGemoetric objects can be created and manipulated using small piecesof codeGeogebra uses Jython, a Java implementation in Python
Rserve packageR package to make a server out of RHence, it is possible to send commands to R from another softwareand get the results backFurthermore, Rserve provide an API in JavaTHis API can be easily imported using Geogebra’s PythonWindowAnd it can be included in Geogebra because it is written in JAVA!!
V. Gómez Rubio et al. (UCLM) Geogebra and R 3 / 12
Geogebra with R and Rserve
V. Gómez Rubio et al. (UCLM) Geogebra and R 4 / 12
Example 1: Sampling random points in R
#Simulamos 10 puntos al azar en R y los dibujamos en Geogebra#desde la Ventana de Python
import sys;
sys.path.append("/home/virgil/Rservejar/Rserve.jar");sys.path.append("/home/virgil/Rservejar/REngine.jar");
from org.rosuda.REngine.Rserve import RConnection;
R= RConnection();
#Ten random pointsR.eval("set.seed(1); d<-data.frame(x=runif(10), y=runif(10))");
for i in range(1,11):Point(R.eval(’d[%d,1]’%(i)).asDouble(),
R.eval(’d[%d,2]’ % (i)).asDouble());
V. Gómez Rubio et al. (UCLM) Geogebra and R 5 / 12
Example 1: Sampling random points in R
V. Gómez Rubio et al. (UCLM) Geogebra and R 6 / 12
Example 2: Control bands
V. Gómez Rubio et al. (UCLM) Geogebra and R 7 / 12
Example 3: Importing maps into Geogebra
V. Gómez Rubio et al. (UCLM) Geogebra and R 8 / 12
Example 4: Smoothing using ’lowess’
V. Gómez Rubio et al. (UCLM) Geogebra and R 9 / 12
Example 5: Point Patterns
V. Gómez Rubio et al. (UCLM) Geogebra and R 10 / 12
Final remarks
We have shown several examples on how Geogebra can be used toteach StatisticsThis can be used, not only for high school students, but for collegestudentsWe have introduced a powerful link between Geogebra and RHence, R packages can be used from GeogebraHowevere, R cannot access the varialbes in Geogebra (data sheets,GUI, etc.) with this linkWe are working on a connection based on rJava which provides abetter link:
Direct access to Geogebra objectsNew geometric objects can be created from RHandling geometric objects from R
V. Gómez Rubio et al. (UCLM) Geogebra and R 11 / 12
References
Geogebra developers web site:https://dev.geogebra.org
R software:http://www.r-project.org
Link between Geogebra and R:http://www.uclm.es/profesorado/vgomez/GeogebraR
V. Gómez Rubio et al. (UCLM) Geogebra and R 12 / 12