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]]

Steven Stoline | 12 Oct 16:31 2014
Picon

R codes for numerical analysis methods

Dear All:

I am wondering if I can find R codes (functions) for numerical analysis
methods, linear algebra, and differential equations available somewhere.

many thanks
steve

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

	[[alternative HTML version deleted]]

Steven Stoline | 10 Sep 05:12 2014
Picon

length of vectors with tapply

Dear All:

I was trying to get the lengths of vectors using "length" in tapply as
follows:

ni<-tapply(data[,2], data[,2], length, na.rm=TRUE)

but it did not work for me. I am not sure what I am doing wrong.

I am not sure if I should use different function.

Here is the data:
============
data<-matrix(c(8,24,0,0,16,32,6,0,16,7,4,4,9,5,8,18,2,0,4,0,8,3,1,5,24,12,2,8,1,8,
1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,2,2,2,2,2,2,2,2,2,2,3,3),30,2)

The answer should be:

ni: 18  ,  10  ,  2

thank you very much
Steven

--

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

	[[alternative HTML version deleted]]
(Continue reading)

AbouEl-Makarim Aboueissa | 14 Aug 19:08 2014
Picon

R codes for Sampling Techniques, 3rd Ed., by William Cochran

Dear All: (I posted this request in February 2014)

I am going to teach Sampling Methods course in Fall 2014. I am going to use the book by William Cochran,
Sampling Techniques, 3rd Ed.

I am wondering if someone have R codes for examples and selected problems given in this textbook.

Any examples and/or exercises will help.

Thank you very much in advance.

Abou

 
==========================
AbouEl-Makarim Aboueissa, Ph.D.
Associate Professor of Mathematics & Statistics
Graduate Program Coordinator
Department of Mathematics & Statistics
University of Southern Maine
96 Falmouth Street
P.O. Box 9300
Portland, ME 04104-9300
USA

Tel: (207) 228-8389
Fax: (207) 780-5607
Email: aaboueissa <at> usm.maine.edu
          aboueiss <at> yahoo.com

(Continue reading)

Antonio Pedro Ramos | 15 Jul 03:19 2014
Picon

Stay in touch with me on LinkedIn

Hi ,

I&#39;d like to add you to my professional network on LinkedIn.

- Antonio Pedro

Accept: https://www.linkedin.com/e/v2?e=-a8lqvc-hxmj86om-4g&a=preRegInvite&tracking=eml-guest-invite-cta&ek=invite_guest&invitationID=5894620955984023552&sharedKey=lM5lhWtM

You are receiving Invitation emails. Unsubscribe here: https://www.linkedin.com/e/v2?e=-a8lqvc-hxmj86om-4g&t=uns&tracking=eml-guest-invite-unsubscribe&ek=invite_guest&id=20061&mid=-1&aid=iuehc9r3r0sm6r3&eid=-a8lqvc-hxmj86om-4g&email=r-sig-teaching%40r-project%2Eorg

 Learn why we included this at the following link: http://www.linkedin.com/e/v2?e=-a8lqvc-hxmj86om-4g&a=customerServiceUrl&ek=invite_guest&articleId=4788
&copy; 2014, LinkedIn Corporation. 2029 Stierlin Ct. Mountain View, CA 94043, USA
	[[alternative HTML version deleted]]


Gmane