Steven Stoline | 7 Jan 13:23 2016

Solve an Equation Including Integral

Dear All:

I am trying to solve an equation including an integral for unknown

Is this can be done in R? if so, any helps will be highly appreciated

### The following function is a function of t, given exi, nu, and alpha.


### I want to solve "[Integral(-Inf,100) fun(exi,nu,alpha)]-(1-alpha)=0"
for t.

### That is, find the value of t which satisfy the equation:

             [Integral(-Inf,100) fun(exi,nu,alpha)]-(1-alpha)=0

### for example given: alpha = 0.05, nu = 20 , exi = 0.5, Solve for t.

with many thanks

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

(Continue reading)

Steven Stoline | 31 Dec 19:31 2015

Histogram for Left Censored Data

Dear All:

*P.S.* I submitted this request to r-help <at> , but did not get
any response. I am not sure, what is wrong. I already subscribe to this
list too.

I need helps with creating histograms for data that include left censored

Here is an example of left censored data


*Column 2* is an indicator for censoring "*1*" for left censored
observations and "*0*" for non-censored (fully measured) observations.

with many thanks


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

	[[alternative HTML version deleted]]

(Continue reading)

Steven Stoline | 27 Dec 07:42 2015

Land C. E., H-Factor used in the CI for the Lognormal Mean

Dear All:

I am wondering if there is a built-in R function or command to compute the
Land C. E. H-factor for computing the confidence interval on the lognormal
arithmetic mean. If not, I am not sure if someone wrote an R function to
read this H-factor. Any helps will be highly appreciated.

with many thanks

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

	[[alternative HTML version deleted]]

Steven Stoline | 26 Dec 12:02 2015

Re: Graph Two Series over Time

Dear Randall:

Thank you very much for the details and for your support and patience.

### This how are the original data look like:
### ---------------------------------------------------




The data values in red font are *Non-detected*. So I need to make
difference between these non-detected values and the detected ones in the

For example, solid circle for the detected ones, and open circles for the
non-detected one (the ones in red font).

So, I was trying to use pch for.

Please notice that, now, both data sets Well1 and Well2, and date have the
same length of 15, but Well1 has one NA, and Well2 has two NA.

Happy Holiday and Happy Christmas (if you are celebrating)

with many thanks
(Continue reading)

Steven Stoline | 24 Dec 13:51 2015

Graph Two Series over Time

Dear All:

I am trying to plot two series in one graph. But I have some difficulties
to set up the y-axis lim. Also, the second series is not correctly graphed.

*Here is what I tried to do:*

### Define 2 vectors


### Calculate range from 0 to max value of Well1 and Well2
### g_range <- range(0, Well1, Well2)

max_y <- max(Well1, Well2)

### Graph Groundwater Concentrations using y axis that ranges from 0 to max
### value in Well1 or Well2 vector.  Turn off axes and
### annotations (axis labels) so we can specify them yourself

plot(Well1, type="o", pch=c(0,0,15,15,0,15,15,15,15,15,15,15,15,15),
col="blue", ylim=c(0,max_y), axes=FALSE, ann=FALSE, , lwd=3, cex=1.25)  ###

### Make x axis using Jan 2005 - Dec 2008 labels

axis(1, at=1:14,

(Continue reading)

Steven Stoline | 22 Dec 09:36 2015

subsetting data with the median position

Dear All:

is there away for subsetting data by the median position?


*Data1: *2, 4, 8, 9,11,11,12  *(n is odd)*

*Data1: *2,4,8,9,11,11,12,15

*  (n is even)*
for Data1:

* I want to get:*

*lower half:      2    4    8*

*upper half:    11   11   12*

*for Data2: I want to get:*

*lower half:     2   4      8    9*

*upper half:   11   11   12   15*

with many thanks


(Continue reading)

John Maindonald | 28 Nov 08:34 2015

Re: Choice of graphics package

> "To do that effectively with lattice graphics you have to learn how to write panel functions"

There is an alternative mechanism that is usually easier.

The latticeExtra layering functions, due to Felix Andrews, overlay (or underlay) 
onto an existing trellis object.  The relevant functions are layer(), layer_(), 
glayer() (where there are groups), glayer_(), and as.layer().  The as.layer() 
function turns a trellis object into a layer that can then be ‘added' onto another
object.  The drawLayer() function provides a more interactive mechanism for 
achieving the same end.   These functions ought to be more widely known and
better advertised.  They are often easier to work with than panel functions.

My brief overview of these abilities can be found at:

Click on 'Layering in lattice’.

John Maindonald             email: john.maindonald <at>

> On 28/11/2015, at 00:00, Drew Tyre <atyre2 <at>> wrote:
> Message: 3
> Date: Thu, 26 Nov 2015 16:33:40 +0000
> From: Drew Tyre <atyre2 <at>>
> To: "Granaas, Michael" <Michael.Granaas <at>>, R-sig-teaching
> 	<r-sig-teaching <at>>
> Subject: Re: [R-sig-teaching] Choice of graphics package
(Continue reading)

Drew Tyre | 26 Nov 17:33 2015

Re: Choice of graphics package

I use R to teach graduate students in the life sciences (mostly ecology but branching out). So far I show
students both lattice and base  graphics. I like lattice graphics for exploration because of the ease of
faceting plots. I use base graphics for "production plots" because I find it easier to tell people how to
add things to a base plot (multiple lines etc). To do that effectively with lattice graphics you have to
learn how to write panel functions, and that can be a mind bending experience (it was/is for me). 

I have not developed the facility with ggplot that I have with base graphics, so I can't comment on it. I think
if one comes to truly understand the ggplot model it will be better/faster/easier than either base or
lattice graphics, but it's a new model. I don't know which will be easier to teach to students hitting it
"cold". I'd be interested in hearing from people that have tried teaching ggplot to students with no prior

Drew Tyre

School of Natural Resources
University of Nebraska-Lincoln
416 Hardin Hall, East Campus
3310 Holdrege Street
Lincoln, NE 68583-0974

phone: +1 402 472 4054
fax: +1 402 472 2946
email: atyre2 <at>

From: R-sig-teaching <r-sig-teaching-bounces <at>> on behalf of Granaas, Michael <Michael.Granaas <at>>
(Continue reading) | 26 Nov 00:28 2015

Re: purpose of the list

Forwarded message:
> From: Ista Zahn <istazahn <at>>
> To: Steven Stoline <sstoline <at>>
> On Nov 25, 2015 5:48 PM, "Steven Stoline" <sstoline <at>> wrote:
> >
> > Dear Hadley:
> >
> >
> > In fact I am teaching R this semester for undergraduate students. In
> > addition, I am using R in most of the classes I teach.
> Sure, but your question was about basic extraction, not about teaching. As
> Hadley suggested R-help is more appropriate for questions like this.
> Best,
> Ista

The official blurb is open to interpretation but I agree with Ista.

"Special Interest Group (SIG) on teaching statistics with R. The
primary purpose of the group is to provide a forum where instructors
using R in their statistics courses can share ideas, teaching
materials, and experiences. One particular focus of the SIG is to
provide helpful support to instructors new to R who are teaching
introductory statistics courses populated with students with little
experience in statistics, statistical software, and command line

------->  First-time AP Stats. teacher?  Help is on the way! See
(Continue reading)

Steven Stoline | 25 Nov 18:47 2015

Re: Shading Area

Dear Robin:

it works

with many thanks

On Wed, Nov 25, 2015 at 12:44 PM, Donatello, Robin <rdonatello <at>>

> Use the polygon() function where x and y are the vertices of the area you
> want shaded.
> polygon(x=c(0,10,10,0),c(3,3,7,7),col=adjustcolor("gray", alpha.f=.5))
> polygon(x=c(5,7,7,5),c(0,0,10,10),col=adjustcolor("blue", alpha.f=.5))
> Robin Donatello, DrPH
> Assistant Professor
> Department of Mathematics and Statistics
> California State University Chico
> Holt 216
> 530-898-5767
> rdonatello <at>
> ________________________________________
> From: R-sig-teaching <r-sig-teaching-bounces <at>> on behalf of
> Steven Stoline <sstoline <at>>
> Sent: Wednesday, November 25, 2015 9:34 AM
(Continue reading)

Steven Stoline | 25 Nov 18:34 2015

Shading Area

Dear All:

How to shade the area between the lines  y = 3 and y = 7 (with gray color
(say),  and between the lines x = 5 and x = 7? with color light blue (say).

*here is the R code:*

plot(0:10, 0:10, type = "n", xaxt = "n", yaxs = "i", xaxs = "i", yaxt =
"n", xlab = "", ylab = "")

text(10.15, 0, "x", pos = 4, xpd = NA, cex = 1.25)

text(0, 11.00, "y", pos = 1.85, xpd = NA, cex = 1.25)

abline(h=3.0, col="red", lwd=1.5)
abline(h=7, col="red", lwd=1.5)

abline(v=5.0, col="gray", lwd=2.0)
abline(v=7, col="gray", lwd=2.0)

segments(0,5, 6,5, lty=2, lwd=2.0)
segments(6,0, 6,5, lty=2, lwd=2.0)

with thanks

Steven M. Stoline
1123 Forest Avenue
(Continue reading)