Julian Wells | 23 Feb 12:56 2015
Picon

Re: R-sig-teaching Digest, Vol 74, Issue 7

One might not use tables to *teach* stat.s, but one may wish to provide exam candidates with them.

Julian

On 23 Feb 2015, at 11:00, r-sig-teaching-request <at> r-project.org wrote:

> Send R-sig-teaching mailing list submissions to
> 	r-sig-teaching <at> r-project.org
> 
> To subscribe or unsubscribe via the World Wide Web, visit
> 	https://stat.ethz.ch/mailman/listinfo/r-sig-teaching
> or, via email, send a message with subject or body 'help' to
> 	r-sig-teaching-request <at> r-project.org
> 
> You can reach the person managing the list at
> 	r-sig-teaching-owner <at> r-project.org
> 
> When replying, please edit your Subject line so it is more specific
> than "Re: Contents of R-sig-teaching digest..."
> 
> 
> Today's Topics:
> 
>   1. Re: Normal Distribution Table (Randall Pruim)
> 
> 
> ----------------------------------------------------------------------
> 
> Message: 1
> Date: Mon, 23 Feb 2015 06:15:04 +0000
(Continue reading)

Steven Stoline | 21 Feb 11:37 2015
Picon

Normal Distribution Table

Dear All:

I am trying to use the below R code to create the standard normal
distribution table. But I need some helps on the output:

1- how I can insert one line-space between each two rows.

2- there is  one "<NA>" in the output, how to remove it from the output.

Simply copy-paste the below code into R.

Here is the Code:
============

columnz<-c(0.00, 0.01, 0.02, 0.03, 0.04, 0.05, 0.06, 0.07, 0.08, 0.09)

rowz<-c(0.0,0.1,0.2,0.3,0.4,0.5,0.6,0.7,0.8,0.9,1.0,1.1,1.2,1.3,1.4,1.5,1.6,1.7,1.8,1.9,

2.0,2.1,2.2,2.3,2.4,2.5,2.6,2.7,2.8,2.9,3.0,3.1,3.2,3.3,3.4,3.5,3.6,3.7,3.8,3.9,4.0)

normal.table<-function(columnz,rowz){

m<-length(rowz)

n<-length(columnz)

A<-matrix(NA, nrow = m+1 , ncol = n+1)

for (i in (1:m+1)) {

(Continue reading)

Christopher W. Ryan | 14 Feb 05:27 2015

long term follow up from R workshops with high school students

Some of you may recall, from a couple years back, a discussion of
teaching R to high school students. Thought the group might be
interested in some follow up.

I did two 5-hour workshops with a group of students in a longitudinal
science research class at Rondout Valley High School in the Hudson
Valley region of New York State.

Their teacher is retiring after many years of service, and she was kind
enough to drop me a line.  Edited to remove some personal info, here is
what she wrote:

=============================================
HI Chris,

. . . I did want to tell you that three of my senior students (you came
to visit these students 2X) have continued to learn R up to an
intermediate level. Two of my juniors (out of six) are learning R on
their own up to an intermediate level. Two of these have research
projects that will involve R in the analysis. Two students did not use R
but are capable of using other statistical analysis programs. Of my
twelve Junior and senior students  five of them are much more capable
with statistical analysis and readily continue to pursue coding and
statistics. One of the Juniors is teaching other students R and other
coding and has formed a computer club. I am really amazed at this
success . . . .  This is an inspiration to me. Students are willing to
go into areas that are completely unknown and become mathematically
literate in coding and statistics . . . . So you are right Chris you can
tell your friends on the R list that high school students can learn R
and become adept at it.
(Continue reading)

Manel Amado Martí | 5 Feb 09:08 2015

Optimizing loop

I'm processing a table database. To do that, I put it in a dataframe, and then I do the data processing
(normalization of some fields). I'm used to program in C, and some R's facilities are not so natural to me,
please, excuse me if the question is for "dummies".
In the processing, I want to substitute some field's value depending on the previous content. For example,
if field starts with a digit instead of an alpha character, the entire field from the actual row, I'll
replace it with "SOLPD". I'm sure that would be another way (maybe through some apply function), but I
can't figure how to do.
The code that I'm using now, is:
for( i in 1:nrow(dataframe2)) {
        if(is.na(dataframe2[i,"NIF/NIE"])==FALSE){
                if(str_locate(dataframe2[i,"NIF/NIE"],"\\d")[1]<2){
                        sprintf("elimina NIF autnom: % i\n",i)
                        dataframe2[i,"NIF"]<-"SLOPD"}
                }
        }
}

Thank you for your attention!

Manel Amado i Mart
Cap d'Assessoria de Comer Interior
amado <at> cambrasabadell.org<mailto:amado <at> cambrasabadell.org>
Tel. 93 745 12 63  Fax 93 745 12 64   
[http://www.cambrasabadell.org/Ficheros/mails/Plantilles/facebook.png]
<https://www.facebook.com/cambrasabadell>  
[http://www.cambrasabadell.org/Ficheros/mails/Plantilles/Twitter.png]
<https://twitter.com/CambraSabadell>  
[http://www.cambrasabadell.org/Ficheros/mails/Plantilles/LinkedIn.png] <http://www.linkedin.com/company/cambra-de-comer-de-sabadell?trk=company_name>
Av. Francesc Maci, 35  08206 Sabadell
Apt. corr. 119  www.cambrasabadell.org<http://www.cambrasabadell.org>
(Continue reading)

Steven Stoline | 8 Jan 19:06 2015
Picon

Analyze Nested and Split-Plot Designs with R

Dear All:

example 14.1, Montgomery, chapter 14. *Supplier* is a *fixed factor*,
*Batches* is a *random factor* nested within the fixed factor Supplier.

How to analyze these data in R in two ways:

1- Nested Design

fit <- aov(purity~Supplier/Batch)

it did not give me the expected output.

2- as a factorial (suppliers Fixed, Batches Random)

fit.out <- aov(Purity~Supplier*Batch, data=have)

it did not give me the expected output.

Here is the data set:
===============

> data
  Supplier Batch  Purity
1     1  1
1     1 -1
1     1  0
1     2 -2
1     2 -3
1     2 -4
(Continue reading)

Nguyen C. | 5 Jan 16:48 2015
Picon

Could not load mosaic package

Dear all,
I have installed the latest version of R (64) and mosaic  package
sucessfully in my laptop (windown 7).
But when I try to load mosaic with comand >library(mosaic), I got the
following message:
###
>library(mosaic)
Loading required package: car
Loading required package: dplyr
Error in get(".packageName", where) :
  cannot open file 'C:/Users/Nguyen
Tu/Documents/R/win-library/3.1/DBI/R/DBI.rdb': No such file or directory
Error: package ‘dplyr’ could not be loaded
>
###
I look at the win-library as mentioned above, then the folder
'C:/Users/Nguyen Tu/Documents/R/win-library/3.1/DBI/' is empty.
I do not know what is wrong and how to correct the problem.

Please help me.
Thank you in advance.
Tu

	[[alternative HTML version deleted]]

_______________________________________________
R-sig-teaching <at> r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-sig-teaching
Warford, Stan | 30 Dec 23:49 2014

Legend for curve fit plot

Hello all,

I provide a function for my students to do two curve fits with a single set of data:

# Performs two curve fits, quadratic and n lg n, with a plot of the data and the two curves
# First parameter: A data frame
# Second parameter: Name of the independent (x) variable
# Third parameter: Name of the dependent (y) variable
# Fourth parameter: The label for the x-axis
# Fifth parameter: The label for the y-axis
dp4dsFit <- function(dataFrame, indepVarName, depVarName, xLabel, yLabel) {
  library(ggplot2)
  library(labeling)
  dp4dsQuadraticFit <- lm(dataFrame[,depVarName] ~ poly(dataFrame[,indepVarName],2))
  write("=============\r",file="")
  write("Quadratic fit\r",file="")
  write("=============\r",file="")
  print(summary(dp4dsQuadraticFit))
  dp4dsNlogNFit <- lm(dataFrame[,depVarName] ~
dataFrame[,indepVarName]:log(dataFrame[,indepVarName]) + dataFrame[,indepVarName])
  write("==========\r",file="")
  write("n lg n fit\r",file="")
  write("==========\r",file="")
  print(summary(dp4dsNlogNFit))
  ggplot() +
    geom_point(data = dataFrame, aes_string(x = indepVarName, y = depVarName), size = 3) +
    geom_smooth(data = dataFrame, aes_string(x = indepVarName, y = depVarName),
                method = "lm", se = FALSE, colour = "RED", formula = y ~ poly(x,2)) +
    geom_smooth(data = dataFrame, aes_string(x = indepVarName, y = depVarName),
                method = "lm", se = FALSE, colour = "BLUE", formula = y ~ x:log(x) + x) +
(Continue reading)

Steven Stoline | 29 Dec 00:35 2014
Picon

Problem with "attach"

Dear All:

I do have problem with attach. I believe that I am doing the data.frame
correctly. But it seems that I do have problem with the "attach" statement.

here is what I am doing:

contributions<-c(1000,1500,1200,1800,1600,1100,1000,1250,1500,1800,2000,1200,2000,1700,1800,1900,900,1000,1200,1500,1200,1550,1000,1100)
contributions

### approach<-c(rep(1,8), rep(2,8), rep(3,8))

approach<-c(1,1,1,1,1,1,1,1,2,2,2,2,2,2,2,2,3,3,3,3,3,3,3,3)
approach

n<-length(contributions)

donations <- data.frame(approach=approach,contributions=contributions)
donations

attach(donations)

the code "*plot(approach~contributions)* " should yield the box-plots, but
it does not.

This what I got from R:
================

> attach(donations)
The following objects are masked _by_ .GlobalEnv:
(Continue reading)

Yahoo! | 22 Dec 14:26 2014
Picon

random effect model in R---- lmer

Dear All:

 
I am trying to run arandom effect model in R, but when I used "lmer" I got the followingerrors: Please see below.

 
library(lme4)

 
batchlevel <-c(1,1,1,2,2,2,3,3,3,4,4,4,5,5,5)

 
batch <-as.character(batchlevel)

 
yield <-c(74,76,75,68,71,72,75,77,77,72,74,73,79,81,79)

 
dataaov <-data.frame(batch,yield)

 
raneff <-lmer(yield~1+(1|batch),data=dataaov)

 
Error in get(name,envir = asNamespace(pkg), inherits = FALSE) : 

  object'.setDummyField' not found

 
summary(raneff)
(Continue reading)

Yahoo! | 22 Dec 00:45 2014
Picon

lmer

Dear All:
I am trying to run a random effect model in R, but when I used "lmer" I got the following errors: Please see below.
library(lme4)
batchlevel <- c(1,1,1,2,2,2,3,3,3,4,4,4,5,5,5)

batch <- as.character(batchlevel)
yield <- c(74,76,75,68,71,72,75,77,77,72,74,73,79,81,79)
dataaov <- data.frame(batch,yield)
raneff <- lmer(yield~1+(1|batch),data=dataaov)

Error in get(name, envir = asNamespace(pkg), inherits = FALSE) :   object '.setDummyField' not found
summary(raneff)

 Error in summary(raneff) :   error in evaluating the argument 'object' in selecting a method for
function 'summary': Error: object 'raneff' not found

Any help will be highly appreciated.
many thanksabou

========================
AbouEl-Makarim Aboueissa
Sozan Elsalakawy
Mohamed Agamia

246 Auburn Street, #158
Portland, ME 04103
USA

Tel: (207) 797-2724
Email: aboueiss <at> yahoo.com
(Continue reading)

Steven Stoline | 20 Oct 10:47 2014
Picon

plot an angle of 450 degrees and adding a circular arrow to it

Dear All:

I am wondering if someone can show me how to plot an angles around the
center of a unit circle with x-y vertices added to it.

Also how to add arrows showing the size and the direction of angle(s).

Examples: 135 degrees and 450 degrees angles.

with many thanks
Steven

--

-- 
Steven M. Stoline
1123 Forest Avenue
Portland, ME 04112
sstoline <at> gmail.com

	[[alternative HTML version deleted]]


Gmane