Steven Stoline | 7 Jan 13:23 2016
Picon

Solve an Equation Including Integral

Dear All:

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

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.

fun<-function(exi,nu,alpha)
(nu+t^2)^(-(nu+1)/2)*exp(((nu+1)*exi*t)/((nu+t^2)^0.5))

### 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
steve

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

(Continue reading)

Steven Stoline | 31 Dec 19:31 2015
Picon

Histogram for Left Censored Data

Dear All:

*P.S.* I submitted this request to r-help <at> r-project.org , 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
observations.

Here is an example of left censored data

*Sulfate.Concentration*
<-matrix(c(1450,1800,1840,1820,1860,1780,1760,1800,1900,1770,1790,1780,1850,1760,1450,1710,1575,1475,1780,1790,1780,1450,1790,1800,
1,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,1,0,0),24,2)

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

with many thanks
steve

--

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

	[[alternative HTML version deleted]]

(Continue reading)

Steven Stoline | 27 Dec 07:42 2015
Picon

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
Steve

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

	[[alternative HTML version deleted]]

Steven Stoline | 26 Dec 12:02 2015
Picon

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:
### ---------------------------------------------------

Well1<-c(*0.005,0.005*,0.004,0.006,*0.004*
,0.009,0.017,0.045,0.05,0.07,0.12,0.10,NA,0.20,0.25)

Well2<-c(*0.10*,0.12,0.125,0.107,*0.099*,0.11,0.13,0.109,NA,*0.10*
,0.115,0.14,0.17,NA,0.11)

date<-c("2Jan2005","7April05","17July05","24Oct05","7Jan06","30March06","28Jun06","2Oct06","17Oct06","15Jan07","10April07","9July07","5Oct07","29Oct07","30Dec07")

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
graph.

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
Picon

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

Well1<-c(0.005,0.005,0.004,0.006,0.004,0.009,0.017,0.045,0.05,0.07,0.12,0.10,0.20,0.25)
Well2<-c(0.10,0.12,0.125,0.107,0.099,0.11,0.13,0.109,0.10,0.115,0.14,0.17,0.11)

### 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)  ###
axes=FALSE,

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

axis(1, at=1:14,
lab=c("Jan05","April05","Jul05","Oct05","Jan06","March06","Jun06","2Oct06","17Oct06","Jan07","April07","Jul07","Oct07","Dec07"))

(Continue reading)

Steven Stoline | 22 Dec 09:36 2015
Picon

subsetting data with the median position

Dear All:

is there away for subsetting data by the median position?

Example:
------------

*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
steve

--

-- 
(Continue reading)

John Maindonald | 28 Nov 08:34 2015
Picon
Picon

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:

  http://maths-people.anu.edu.au/~johnm/r-book/add-graphics.html


Click on 'Layering in lattice’.

John Maindonald             email: john.maindonald <at> anu.edu.au


> On 28/11/2015, at 00:00, Drew Tyre <atyre2 <at> unl.edu> wrote:
> 
> Message: 3
> Date: Thu, 26 Nov 2015 16:33:40 +0000
> From: Drew Tyre <atyre2 <at> unl.edu>
> To: "Granaas, Michael" <Michael.Granaas <at> usd.edu>, R-sig-teaching
> 	<r-sig-teaching <at> r-project.org>
> 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
expeRience. 

--
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> unl.edu
http://snr.unl.edu/tyre
http://aminpractice.blogspot.com
http://www.flickr.com/photos/atiretoo

________________________________________
From: R-sig-teaching <r-sig-teaching-bounces <at> r-project.org> on behalf of Granaas, Michael <Michael.Granaas <at> usd.edu>
(Continue reading)

bob@statland.org | 26 Nov 00:28 2015

Re: purpose of the list

Forwarded message:
> From: Ista Zahn <istazahn <at> gmail.com>
> To: Steven Stoline <sstoline <at> gmail.com>
> 
> On Nov 25, 2015 5:48 PM, "Steven Stoline" <sstoline <at> gmail.com> 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
interfaces."

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

Steven Stoline | 25 Nov 18:47 2015
Picon

Re: Shading Area

Dear Robin:

it works

with many thanks
steve

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

> 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> csuchico.edu
> www.norcalbiostat.com
>
> ________________________________________
> From: R-sig-teaching <r-sig-teaching-bounces <at> r-project.org> on behalf of
> Steven Stoline <sstoline <at> gmail.com>
> Sent: Wednesday, November 25, 2015 9:34 AM
(Continue reading)

Steven Stoline | 25 Nov 18:34 2015
Picon

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
steve

-------------------------
Steven M. Stoline
1123 Forest Avenue
(Continue reading)


Gmane