Re: [R] Difficulty with "\\" in string functions....

2019-02-11 Thread Bernard
Simple when you know how!

Thanks

Sent from mobile device - please excuse any spelling mistakes.



-- Original Message --

From: William Dunlap
To: Bernard McGarvey
Cc: Ivan Krylov, r-help@r-project.org
Sent: February 11, 2019 at 4:29 PM
Subject: Re: [R] Difficulty with "\\" in string functions

You can also avoid the issue by using the basename and dirname functions.

>Fname1<- "D:\\Data\\OneDrive\\ISTA Documents\\QT_App\\QT Analysis Input Data 
>Example WorkBook.xlsx"
>basename(Fname1)
[1] "QT Analysis Input Data Example WorkBook.xlsx"
>dirname(Fname1)
[1] "D:/Data/OneDrive/ISTA Documents/QT_App"


Use normalizePath if you need to convert those / to \ on Windows.

Bill Dunlap
TIBCO Software
wdunlaptibco.com(http://tibco.com)

On Mon, Feb 11, 2019 at 12:26 PM Bernard 
McGarveymailto:mcgarvey.bern...@comcast.net)>wrote:
> Brilliant! Thanks a million Ivan.
> 
> Lion Bernard McGarvey
> 
> 
> Director, Fort Myers Beach Lions Foundation, Inc.
> 
> 
> Retired (Lilly Engineering Fellow).
> 
> 
> >On February 11, 2019 at 3:13 PM Ivan 
> >Krylovmailto:krylov.r...@gmail.com)>wrote:
> >
> >
> >On Mon, 11 Feb 2019 15:01:16 -0500 (EST)
> >Bernard 
> >McGarveymailto:mcgarvey.bern...@comcast.net)>wrote:
> >
> >>Now I try to split it using
> >>
> >>
> >>str_split(Fname1,"\\")
> >>
> >>
> >>but this returns an error
> >>
> >>
> >>Error in stri_split_regex(string, pattern, n = n, simplify =
> >>simplify, : Unrecognized backslash escape sequence in pattern.
> >>(U_REGEX_BAD_ESCAPE_SEQUENCE)
> >
> >This happens because the second parameter of str_split is by default a
> >regular expression, and a backslash has a special meaning in regular
> >expressions: when preceding other characters, it may change the way
> >they are interpreted. (For example, w means a literal "w"
> >character, while \w means "any alphanumeric character". On the
> >other hand, [ starts a character group, but \[ means just an opening
> >square bracket.) See ?regex for more info on that.
> >
> >Since you want a literal backslash, you need to escape it with another
> >backslash: \\
> >
> >But to write a string literal of a double-backslash in R, you need to
> >escape both backslash characters, each with their own backslash: ""
> >
> >## fname<- "D:\\Data\\OneDrive\\ISTA Documents\\QT_App\\QT Analysis
> >Input Data Example WorkBook.xlsx"
> >## message("")
> >\\
> >## str_split(fname, "")
> >[[1]]
> >[1] "D:"
> >[2] "Data"
> >[3] "OneDrive"
> >[4] "ISTA Documents"
> >[5] "QT_App"
> >[6] "QT AnalysisInput Data Example WorkBook.xlsx"
> >
> >You can also avoid all layers of the backslash hell (except the first)
> >if you choose to split by fixed strings instead of regular expressions
> >by using stringr::fixed:
> >
> >## str_split(fname, fixed("\\"))
> >
> >--
> >Best regards,
> >Ivan
> 
> __
> R-help@r-project.org(mailto:R-help@r-project.org)mailing list -- To 
> UNSUBSCRIBE and more, see
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guidehttp://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.

[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[R] JMdesign package

2017-05-22 Thread Bernard North

Dear R list


I wonder please if anyone has experience they can share of the JMdesign package 
that performs sample sized for (surviival/longitudinal) joint models and is 
based on the paper "Sample size and power determination in joint modeling of 
longitudinal and survival data " by Chen et al (Statistics  in Medicine 2011) .

If so I do have a few queries please.

  1.  the vignette states that JMdesign can work when �the variance-covariance 
matrix Sigma_theta is unknown.� This is the the covariance matrix of the 
intercept, linear and quadratic effects of the longitudinal profiles of the 
longitudinal (time-dependent) variable thats affecting event time.

I wonder if that refers to the input SigmaTheta to the R function powerLongSurv 
in the package  ? Because it looks to me as though most of the examples in the 
vignette do supply a value for that matrix and it errors if its missing. I 
realise section 3.2 of the Liddy Chen paper does refer to the unknown 
covariance matrix situation

  2.  I�m also a little confused as to what is meant in the JMdesign vignette 
by �Example 1� and "formula 4.6". Do these refer to the Chen paper ? I can�t 
see a formula denoted 4.6.

  3.  The original Chen paper refers on page 3 to two possible objectives: 1)  
power for testing the effect of the longitudinal trajectory and 2) power for 
testing the effect of a fixed covariate, eg treatment, that affects the 
trajectory (and therefore indirectly survival) but also has a direct effect on 
survival.
Does the power calculation in the current JMdesign package only provide power 
of the first test ?  I think it does but from the paper both calculations are 
possible.

  4.  Can anyone help with how to estimate the covariance matrix of the 
intercept, linear and quadratic effects for the Sigma_theta input. I thought 
theVarCorr output from a lmer mixed model analysis of the profiles might 
provide the elements for that matrix

my apologies for so many questions - many thanks for any thoughts on any of them

best wishes
Bernard

[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

[R] User Interfaces for R

2019-01-10 Thread Bernard McGarvey
I want to create an R application that includes a user interface where the user 
inputs values etc and then can run R calculations and get results back on the 
user interface. I was hoping that an easy to use GUI package exists.


Can anyone point me to such an easy to use package to create GUIs for R?


Thanks in advance for any help.



Lion Bernard McGarvey

Director, Fort Myers Beach Lions Foundation, Inc.

Retired (Lilly Engineering Fellow).



[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[R] Reading an excel file

2019-01-10 Thread Bernard Comcast
What is the best way to read in data of any type from an Excel 2016 .xlsx file?

Thanks

Bernard
Sent from my iPhone so please excuse the spelling!"
__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[R] loading the xlsx library

2019-01-11 Thread Bernard McGarvey
When I load the library xlsx with the command


library("xlsx")


I get the error message:


> library("xlsx")
Error: package or namespace load failed for ‘xlsx’:
.onLoad failed in loadNamespace() for 'rJava', details:
call: fun(libname, pkgname)
error: JAVA_HOME cannot be determined from the Registry
>


Does anyone have any idea what the issue is?


Thanks


Lion Bernard McGarvey

Director, Fort Myers Beach Lions Foundation, Inc.

Retired (Lilly Engineering Fellow).



[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[R] Difficulty with "\\" in string functions....

2019-02-11 Thread Bernard McGarvey
I am using the file.choose() function to choose a file from the dialog box and 
once I get it, I want to be able to split the full name into the folder part 
and the file name part. So for example, when I have closed the file choose 
dialog, the name for the file I get is


Fname1
[1] "D:\\Data\\OneDrive\\ISTA Documents\\QT_App\\QT Analysis Input Data Example 
WorkBook.xlsx"


where the "\\" is used to split the folder and sub-folder and file names. R see 
this "\\" as a single \ backslash character.


Now I try to split it using


str_split(Fname1,"\\")


but this returns an error


Error in stri_split_regex(string, pattern, n = n, simplify = simplify, :
Unrecognized backslash escape sequence in pattern. (U_REGEX_BAD_ESCAPE_SEQUENCE)


I know its got something to do with the \\ because it is treated as a single 
backslash character. But replacing the str_split with


str_split(Fname1,"\")


does not work either. 


Any ideas on how I can handle the \\ and split the full name into its pieces?



Lion Bernard McGarvey

Director, Fort Myers Beach Lions Foundation, Inc.

Retired (Lilly Engineering Fellow).



[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] Difficulty with "\\" in string functions....

2019-02-11 Thread Bernard McGarvey
Brilliant! Thanks a million Ivan.

Lion Bernard McGarvey


Director, Fort Myers Beach Lions Foundation, Inc.


Retired (Lilly Engineering Fellow).


> On February 11, 2019 at 3:13 PM Ivan Krylov  wrote:
> 
> 
> On Mon, 11 Feb 2019 15:01:16 -0500 (EST)
> Bernard McGarvey  wrote:
> 
> > Now I try to split it using
> > 
> > 
> > str_split(Fname1,"\\")
> > 
> > 
> > but this returns an error
> > 
> > 
> > Error in stri_split_regex(string, pattern, n = n, simplify =
> > simplify, : Unrecognized backslash escape sequence in pattern.
> > (U_REGEX_BAD_ESCAPE_SEQUENCE)
> 
> This happens because the second parameter of str_split is by default a
> regular expression, and a backslash has a special meaning in regular
> expressions: when preceding other characters, it may change the way
> they are interpreted. (For example, w means a literal "w"
> character, while \w means "any alphanumeric character". On the
> other hand, [ starts a character group, but \[ means just an opening
> square bracket.) See ?regex for more info on that.
> 
> Since you want a literal backslash, you need to escape it with another
> backslash: \\
> 
> But to write a string literal of a double-backslash in R, you need to
> escape both backslash characters, each with their own backslash: ""
> 
> ## fname <- "D:\\Data\\OneDrive\\ISTA Documents\\QT_App\\QT Analysis
> Input Data Example WorkBook.xlsx"
> ## message("")
> \\
> ## str_split(fname, "")
> [[1]]
> [1] "D:" 
> [2] "Data"   
> [3] "OneDrive"   
> [4] "ISTA Documents" 
> [5] "QT_App" 
> [6] "QT AnalysisInput Data Example WorkBook.xlsx"
> 
> You can also avoid all layers of the backslash hell (except the first)
> if you choose to split by fixed strings instead of regular expressions
> by using stringr::fixed:
> 
> ## str_split(fname, fixed("\\"))
> 
> -- 
> Best regards,
> Ivan

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[R] Weather station data

2019-02-17 Thread Bernard Comcast
Is anyone aware of any R capability to access data at weather stations around 
the globe? An R package perhaps?

Thanks

Bernard
Sent from my iPhone so please excuse the spelling!"
__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[R] Error trapping in R

2019-02-27 Thread Bernard Comcast
What is the recommended way to trap errors in R? My main need is to be able to 
trap an error and then skip a section of code if an error has occurred. In VB 
for Excel I used the “On Error goto  .” construct to do this.

Bernard
Sent from my iPhone so please excuse the spelling!"
__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] Error trapping in R

2019-02-27 Thread Bernard Comcast
Thanks

Bernard
Sent from my iPhone so please excuse the spelling!"

> On Feb 27, 2019, at 4:05 PM, Duncan Murdoch  wrote:
> 
>> On 27/02/2019 3:55 p.m., Bernard Comcast wrote:
>> What is the recommended way to trap errors in R? My main need is to be able 
>> to trap an error and then skip a section of code if an error has occurred. 
>> In VB for Excel I used the “On Error goto  .” construct to do this.
> 
> The recommended way is to use tryCatch() around the expression you're 
> evaluating.  A simpler, less flexible alternative is try().  The Excel 
> version sounds a bit more like try().  You'd use it like this:
> 
>  value <- try({ x <- 1
> y <- someFunction(x)
> someOtherFunction(y)
>   })
>  if (inherits(value, "try-error")) {
>cat ("something went wrong.  There's information in value about what 
> happened.")
>  } else {
>cat ("value is fine, there was no error.")
>  }
> 
> Duncan Murdoch

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] Error trapping in R

2019-02-28 Thread Bernard McGarvey
Thanks - the try() approach is exactly what I need.



Lion Bernard McGarvey

Director, Fort Myers Beach Lions Foundation, Inc.

Retired (Lilly Engineering Fellow).



> On February 27, 2019 at 4:39 PM Robert Knight  wrote:
> 
> Some use try blocks, like found in other languages.  Put the code you 
> want to try inside the block.
> 
> https://www.robertknight.io/blog/try-blocks-in-r-for-error-handling/ 
> contains a quick example.  The example doesn’t raise exceptions or anything, 
> it just contains it for you so the script keeps going.  I like handling 
> errors with if statements inside of try blocks.
> 
> Robert
> 
> 
> 
> On Feb 27, 2019, at 2:55 PM, Bernard Comcast < 
> mcgarvey.bern...@comcast.net mailto:mcgarvey.bern...@comcast.net > wrote:
> 
> 
> > > What is the recommended way to trap errors in R? My main 
> need is to be able to trap an error and then skip a section of code if an 
> error has occurred. In VB for Excel I used the “On Error goto  .” 
> construct to do this.
> > 
> > Bernard
> > Sent from my iPhone so please excuse the spelling!"
> > __
> > R-help@r-project.org mailto:R-help@r-project.org mailing list -- To 
> > UNSUBSCRIBE and more, see
> > https://stat.ethz.ch/mailman/listinfo/r-help
> > PLEASE do read the posting guide 
> > http://www.R-project.org/posting-guide.html
> > and provide commented, minimal, self-contained, reproducible code.
> > 
> > > 


 

[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[R] Quantile Density Contours

2019-03-26 Thread Bernard McGarvey
I want to see if I can reproduce the plot below in R. If I understand it 
correctly, i takes my bivariate data and creates quantile density contours. My 
interpretation of these contours is that they enclose a certain % of the total 
data. I am using the bkde2D function in library KernSmooth which gives density 
values that can be plotted on a contour plot but I would like the curves that 
enclose a given % of the data, if that is possible


Thanks





Bernard McGarvey

Director, Fort Myers Beach Lions Foundation, Inc.

Retired (Lilly Engineering Fellow).


__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] Quantile Density Contours

2019-03-27 Thread Bernard McGarvey
John, I have attached a pdf of the plot. Hopefully you can read this.

If I understand correctly, this plot is basically the 2-D version of the 1-D 
quantile plot.

Thanks

Bernard McGarvey


Director, Fort Myers Beach Lions Foundation, Inc.


Retired (Lilly Engineering Fellow).


> On March 27, 2019 at 7:44 AM John Kane  wrote:
> 
> 
> The figure did not get  through. Perhaps try a pdf?
> 
> On Tue, 26 Mar 2019 at 13:41, Bernard McGarvey
>  wrote:
> >
> > I want to see if I can reproduce the plot below in R. If I understand it 
> > correctly, i takes my bivariate data and creates quantile density contours. 
> > My interpretation of these contours is that they enclose a certain % of the 
> > total data. I am using the bkde2D function in library KernSmooth which 
> > gives density values that can be plotted on a contour plot but I would like 
> > the curves that enclose a given % of the data, if that is possible
> >
> >
> > Thanks
> >
> >
> >
> >
> >
> > Bernard McGarvey
> >
> > Director, Fort Myers Beach Lions Foundation, Inc.
> >
> > Retired (Lilly Engineering Fellow).
> >
> >
> > __
> > R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
> > https://stat.ethz.ch/mailman/listinfo/r-help
> > PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> > and provide commented, minimal, self-contained, reproducible code.
> 
> 
> 
> -- 
> John Kane
> Kingston ON Canada

Qunatile Density Contours Plot.pdf
Description: Adobe PDF document
__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] [FORGED] Re: Quantile Density Contours

2019-03-27 Thread Bernard McGarvey
If I understand correctly the ContourLines function gives you the contour lines 
when you put in the data. But before this I need to data to put into that 
function. I think this is something like a 2D CDF of the data that then leads 
to the 2D quantiles but I am not 100% sure. What I am basically looking for is 
the 2D curve that encloses say 95% of the data in a similar fashion to a 1D 
quantile where the quantile represents the value that x% of the data is below. 
I think what I am looking for is the 2D bivariate version of the 1D quantile 
plot (where the quantile value is plotted vs the % value).

I hope this makes some sense.

Bernard McGarvey


Director, Fort Myers Beach Lions Foundation, Inc.


Retired (Lilly Engineering Fellow).


> On March 27, 2019 at 3:57 PM Paul Murrell  wrote:
> 
> 
> 
> Are you looking for the contourLines() function ?
> 
> Paul
> 
> On 28/03/19 8:37 AM, Bernard McGarvey wrote:
> > John, I have attached a pdf of the plot. Hopefully you can read this.
> > 
> > If I understand correctly, this plot is basically the 2-D version of the 
> > 1-D quantile plot.
> > 
> > Thanks
> > 
> > Bernard McGarvey
> > 
> > 
> > Director, Fort Myers Beach Lions Foundation, Inc.
> > 
> > 
> > Retired (Lilly Engineering Fellow).
> > 
> > 
> >> On March 27, 2019 at 7:44 AM John Kane  wrote:
> >>
> >>
> >> The figure did not get  through. Perhaps try a pdf?
> >>
> >> On Tue, 26 Mar 2019 at 13:41, Bernard McGarvey
> >>  wrote:
> >>>
> >>> I want to see if I can reproduce the plot below in R. If I understand it 
> >>> correctly, i takes my bivariate data and creates quantile density 
> >>> contours. My interpretation of these contours is that they enclose a 
> >>> certain % of the total data. I am using the bkde2D function in library 
> >>> KernSmooth which gives density values that can be plotted on a contour 
> >>> plot but I would like the curves that enclose a given % of the data, if 
> >>> that is possible
> >>>
> >>>
> >>> Thanks
> >>>
> >>>
> >>>
> >>>
> >>>
> >>> Bernard McGarvey
> >>>
> >>> Director, Fort Myers Beach Lions Foundation, Inc.
> >>>
> >>> Retired (Lilly Engineering Fellow).
> >>>
> >>>
> >>> __
> >>> R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
> >>> https://stat.ethz.ch/mailman/listinfo/r-help
> >>> PLEASE do read the posting guide 
> >>> http://www.R-project.org/posting-guide.html
> >>> and provide commented, minimal, self-contained, reproducible code.
> >>
> >>
> >>
> >> -- 
> >> John Kane
> >> Kingston ON Canada
> >>
> >> __
> >> R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
> >> https://stat.ethz.ch/mailman/listinfo/r-help
> >> PLEASE do read the posting guide 
> >> http://www.R-project.org/posting-guide.html
> >> and provide commented, minimal, self-contained, reproducible code.
> 
> -- 
> Dr Paul Murrell
> Department of Statistics
> The University of Auckland
> Private Bag 92019
> Auckland
> New Zealand
> 64 9 3737599 x85392
> p...@stat.auckland.ac.nz
> http://www.stat.auckland.ac.nz/~paul/

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] [FORGED] Re: Quantile Density Contours

2019-03-27 Thread Bernard Comcast
That thought had crossed my mind so thanks for that clarification Bert. i think 
you are correct and so the plot I am looking at must be doing something 
different than I was thinking.

Thanks

Bernard
Sent from my iPhone so please excuse the spelling!"

> On Mar 27, 2019, at 5:18 PM, Bert Gunter  wrote:
> 
> You are missing a crucial point. The reals are well ordered; higher 
> dimensions are not. Therefore 2d quantile contours are not unique. 
> 
> Of course assuming I understand your query correctly.
> 
> 
> Bert
> 
>> On Wed, Mar 27, 2019, 13:55 Bernard McGarvey  
>> wrote:
>> If I understand correctly the ContourLines function gives you the contour 
>> lines when you put in the data. But before this I need to data to put into 
>> that function. I think this is something like a 2D CDF of the data that then 
>> leads to the 2D quantiles but I am not 100% sure. What I am basically 
>> looking for is the 2D curve that encloses say 95% of the data in a similar 
>> fashion to a 1D quantile where the quantile represents the value that x% of 
>> the data is below. I think what I am looking for is the 2D bivariate version 
>> of the 1D quantile plot (where the quantile value is plotted vs the % value).
>> 
>> I hope this makes some sense.
>> 
>> Bernard McGarvey
>> 
>> 
>> Director, Fort Myers Beach Lions Foundation, Inc.
>> 
>> 
>> Retired (Lilly Engineering Fellow).
>> 
>> 
>> > On March 27, 2019 at 3:57 PM Paul Murrell  wrote:
>> > 
>> > 
>> > 
>> > Are you looking for the contourLines() function ?
>> > 
>> > Paul
>> > 
>> > On 28/03/19 8:37 AM, Bernard McGarvey wrote:
>> > > John, I have attached a pdf of the plot. Hopefully you can read this.
>> > > 
>> > > If I understand correctly, this plot is basically the 2-D version of the 
>> > > 1-D quantile plot.
>> > > 
>> > > Thanks
>> > > 
>> > > Bernard McGarvey
>> > > 
>> > > 
>> > > Director, Fort Myers Beach Lions Foundation, Inc.
>> > > 
>> > > 
>> > > Retired (Lilly Engineering Fellow).
>> > > 
>> > > 
>> > >> On March 27, 2019 at 7:44 AM John Kane  wrote:
>> > >>
>> > >>
>> > >> The figure did not get  through. Perhaps try a pdf?
>> > >>
>> > >> On Tue, 26 Mar 2019 at 13:41, Bernard McGarvey
>> > >>  wrote:
>> > >>>
>> > >>> I want to see if I can reproduce the plot below in R. If I understand 
>> > >>> it correctly, i takes my bivariate data and creates quantile density 
>> > >>> contours. My interpretation of these contours is that they enclose a 
>> > >>> certain % of the total data. I am using the bkde2D function in library 
>> > >>> KernSmooth which gives density values that can be plotted on a contour 
>> > >>> plot but I would like the curves that enclose a given % of the data, 
>> > >>> if that is possible
>> > >>>
>> > >>>
>> > >>> Thanks
>> > >>>
>> > >>>
>> > >>>
>> > >>>
>> > >>>
>> > >>> Bernard McGarvey
>> > >>>
>> > >>> Director, Fort Myers Beach Lions Foundation, Inc.
>> > >>>
>> > >>> Retired (Lilly Engineering Fellow).
>> > >>>
>> > >>>
>> > >>> __
>> > >>> R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
>> > >>> https://stat.ethz.ch/mailman/listinfo/r-help
>> > >>> PLEASE do read the posting guide 
>> > >>> http://www.R-project.org/posting-guide.html
>> > >>> and provide commented, minimal, self-contained, reproducible code.
>> > >>
>> > >>
>> > >>
>> > >> -- 
>> > >> John Kane
>> > >> Kingston ON Canada
>> > >>
>> > >> __
>> > >> R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
>> > >> https://stat.ethz.ch/mailman/listinfo/r-help
>> > >> PLEASE do read the posting guide 
>> > >> http://www.R-project.org/posting-guide.html
>> > >> and provide commented, minimal, self-contained, reproducible code.
>> > 
>> > -- 
>> > Dr Paul Murrell
>> > Department of Statistics
>> > The University of Auckland
>> > Private Bag 92019
>> > Auckland
>> > New Zealand
>> > 64 9 3737599 x85392
>> > p...@stat.auckland.ac.nz
>> > http://www.stat.auckland.ac.nz/~paul/
>> 
>> __
>> R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
>> https://stat.ethz.ch/mailman/listinfo/r-help
>> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
>> and provide commented, minimal, self-contained, reproducible code.

[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] [FORGED] Re: Quantile Density Contours

2019-03-27 Thread Bernard Comcast
To follow on Jeff, is there a function to do 2-D (double) numerical integration 
in R?

Bernard
Sent from my iPhone so please excuse the spelling!"

> On Mar 27, 2019, at 6:38 PM, Jeff Newmiller  wrote:
> 
> Regardless of how many dimensions you have for independent variables, the 
> density is one-dimensional, and if you assume the density function has been 
> determined (e.g. by kernel estimation or by a Gaussian copula) then if you 
> integrate the density function along that dimension there will be unique 
> slices of the multivariate input domain determined by those slices. They 
> might in general be disjoint regions of the independent variable space, but 
> that is what the contour function does.
> 
> I am not seeing your point, Bert, unless you are unwilling to assume a 
> density function model?
> 
>> On March 27, 2019 2:18:18 PM PDT, Bert Gunter  wrote:
>> You are missing a crucial point. The reals are well ordered; higher
>> dimensions are not. Therefore 2d quantile contours are not unique.
>> 
>> Of course assuming I understand your query correctly.
>> 
>> 
>> Bert
>> 
>> On Wed, Mar 27, 2019, 13:55 Bernard McGarvey
>> 
>> wrote:
>> 
>>> If I understand correctly the ContourLines function gives you the
>> contour
>>> lines when you put in the data. But before this I need to data to put
>> into
>>> that function. I think this is something like a 2D CDF of the data
>> that
>>> then leads to the 2D quantiles but I am not 100% sure. What I am
>> basically
>>> looking for is the 2D curve that encloses say 95% of the data in a
>> similar
>>> fashion to a 1D quantile where the quantile represents the value that
>> x% of
>>> the data is below. I think what I am looking for is the 2D bivariate
>>> version of the 1D quantile plot (where the quantile value is plotted
>> vs the
>>> % value).
>>> 
>>> I hope this makes some sense.
>>> 
>>> Bernard McGarvey
>>> 
>>> 
>>> Director, Fort Myers Beach Lions Foundation, Inc.
>>> 
>>> 
>>> Retired (Lilly Engineering Fellow).
>>> 
>>> 
>>>> On March 27, 2019 at 3:57 PM Paul Murrell
>> 
>>> wrote:
>>>> 
>>>> 
>>>> 
>>>> Are you looking for the contourLines() function ?
>>>> 
>>>> Paul
>>>> 
>>>>> On 28/03/19 8:37 AM, Bernard McGarvey wrote:
>>>>> John, I have attached a pdf of the plot. Hopefully you can read
>> this.
>>>>> 
>>>>> If I understand correctly, this plot is basically the 2-D version
>> of
>>> the 1-D quantile plot.
>>>>> 
>>>>> Thanks
>>>>> 
>>>>> Bernard McGarvey
>>>>> 
>>>>> 
>>>>> Director, Fort Myers Beach Lions Foundation, Inc.
>>>>> 
>>>>> 
>>>>> Retired (Lilly Engineering Fellow).
>>>>> 
>>>>> 
>>>>>> On March 27, 2019 at 7:44 AM John Kane 
>> wrote:
>>>>>> 
>>>>>> 
>>>>>> The figure did not get  through. Perhaps try a pdf?
>>>>>> 
>>>>>> On Tue, 26 Mar 2019 at 13:41, Bernard McGarvey
>>>>>>  wrote:
>>>>>>> 
>>>>>>> I want to see if I can reproduce the plot below in R. If I
>>> understand it correctly, i takes my bivariate data and creates
>> quantile
>>> density contours. My interpretation of these contours is that they
>> enclose
>>> a certain % of the total data. I am using the bkde2D function in
>> library
>>> KernSmooth which gives density values that can be plotted on a
>> contour plot
>>> but I would like the curves that enclose a given % of the data, if
>> that is
>>> possible
>>>>>>> 
>>>>>>> 
>>>>>>> Thanks
>>>>>>> 
>>>>>>> 
>>>>>>> 
>>>>>>> 
>>>>>>> 
>>>>>>> Bernard McGarvey
>>>>>>> 
>>>>>>> Director, Fort Myers Beach Lions Foundation, Inc.
>>>>>>> 
>>>>>>> Retired (Lilly Engineering Fellow).
>>>>>>> 
>>>>>>> 
>>>>>>> __
>>>>>>> R-help@r-p

Re: [R] [FORGED] Re: Quantile Density Contours

2019-03-27 Thread Bernard Comcast
No - how do I access that?

Bernard
Sent from my iPhone so please excuse the spelling!"

> On Mar 27, 2019, at 6:57 PM, Jeff Newmiller  wrote:
> 
> I don't know. Have you looked at the Multivariate Task View?
> 
>> On March 27, 2019 3:43:52 PM PDT, Bernard Comcast 
>>  wrote:
>> To follow on Jeff, is there a function to do 2-D (double) numerical
>> integration in R?
>> 
>> Bernard
>> Sent from my iPhone so please excuse the spelling!"
>> 
>>> On Mar 27, 2019, at 6:38 PM, Jeff Newmiller
>>  wrote:
>>> 
>>> Regardless of how many dimensions you have for independent variables,
>> the density is one-dimensional, and if you assume the density function
>> has been determined (e.g. by kernel estimation or by a Gaussian copula)
>> then if you integrate the density function along that dimension there
>> will be unique slices of the multivariate input domain determined by
>> those slices. They might in general be disjoint regions of the
>> independent variable space, but that is what the contour function does.
>>> 
>>> I am not seeing your point, Bert, unless you are unwilling to assume
>> a density function model?
>>> 
>>>> On March 27, 2019 2:18:18 PM PDT, Bert Gunter
>>  wrote:
>>>> You are missing a crucial point. The reals are well ordered; higher
>>>> dimensions are not. Therefore 2d quantile contours are not unique.
>>>> 
>>>> Of course assuming I understand your query correctly.
>>>> 
>>>> 
>>>> Bert
>>>> 
>>>> On Wed, Mar 27, 2019, 13:55 Bernard McGarvey
>>>> 
>>>> wrote:
>>>> 
>>>>> If I understand correctly the ContourLines function gives you the
>>>> contour
>>>>> lines when you put in the data. But before this I need to data to
>> put
>>>> into
>>>>> that function. I think this is something like a 2D CDF of the data
>>>> that
>>>>> then leads to the 2D quantiles but I am not 100% sure. What I am
>>>> basically
>>>>> looking for is the 2D curve that encloses say 95% of the data in a
>>>> similar
>>>>> fashion to a 1D quantile where the quantile represents the value
>> that
>>>> x% of
>>>>> the data is below. I think what I am looking for is the 2D
>> bivariate
>>>>> version of the 1D quantile plot (where the quantile value is
>> plotted
>>>> vs the
>>>>> % value).
>>>>> 
>>>>> I hope this makes some sense.
>>>>> 
>>>>> Bernard McGarvey
>>>>> 
>>>>> 
>>>>> Director, Fort Myers Beach Lions Foundation, Inc.
>>>>> 
>>>>> 
>>>>> Retired (Lilly Engineering Fellow).
>>>>> 
>>>>> 
>>>>>> On March 27, 2019 at 3:57 PM Paul Murrell
>>>> 
>>>>> wrote:
>>>>>> 
>>>>>> 
>>>>>> 
>>>>>> Are you looking for the contourLines() function ?
>>>>>> 
>>>>>> Paul
>>>>>> 
>>>>>>> On 28/03/19 8:37 AM, Bernard McGarvey wrote:
>>>>>>> John, I have attached a pdf of the plot. Hopefully you can read
>>>> this.
>>>>>>> 
>>>>>>> If I understand correctly, this plot is basically the 2-D version
>>>> of
>>>>> the 1-D quantile plot.
>>>>>>> 
>>>>>>> Thanks
>>>>>>> 
>>>>>>> Bernard McGarvey
>>>>>>> 
>>>>>>> 
>>>>>>> Director, Fort Myers Beach Lions Foundation, Inc.
>>>>>>> 
>>>>>>> 
>>>>>>> Retired (Lilly Engineering Fellow).
>>>>>>> 
>>>>>>> 
>>>>>>>> On March 27, 2019 at 7:44 AM John Kane 
>>>> wrote:
>>>>>>>> 
>>>>>>>> 
>>>>>>>> The figure did not get  through. Perhaps try a pdf?
>>>>>>>> 
>>>>>>>> On Tue, 26 Mar 2019 at 13:41, Bernard McGarvey
>>>>>>>>  wrote:
>>>>>>>>> 
>>>>>>>>> I want to see if I can reproduce the plot below in R. If I
>>>>> understand it correctly, i takes my bivariate data and creates

Re: [R] [FORGED] Re: Quantile Density Contours

2019-03-28 Thread Bernard Comcast
Thanks Petr

Bernard
Sent from my iPhone so please excuse the spelling!"

> On Mar 28, 2019, at 2:26 AM, PIKAL Petr  wrote:
> 
> Hallo Bernard
> 
> I did not follow all emails in this thread but it seems to me that your 
> request is similar to Bioconductor packages dealing with Flow Cytometry data.
> 
> Especially flowViz package is designed to visualise such data.
> 
> Cheers
> Petr
> 
> 
>> -Original Message-
>> From: R-help  On Behalf Of Bernard McGarvey
>> Sent: Wednesday, March 27, 2019 9:55 PM
>> To: Paul Murrell ; John Kane
>> 
>> Cc: R. Help Mailing List 
>> Subject: Re: [R] [FORGED] Re: Quantile Density Contours
>> 
>> If I understand correctly the ContourLines function gives you the contour 
>> lines
>> when you put in the data. But before this I need to data to put into that
>> function. I think this is something like a 2D CDF of the data that then 
>> leads to
>> the 2D quantiles but I am not 100% sure. What I am basically looking for is 
>> the
>> 2D curve that encloses say 95% of the data in a similar fashion to a 1D 
>> quantile
>> where the quantile represents the value that x% of the data is below. I think
>> what I am looking for is the 2D bivariate version of the 1D quantile plot 
>> (where
>> the quantile value is plotted vs the % value).
>> 
>> I hope this makes some sense.
>> 
>> Bernard McGarvey
>> 
>> 
>> Director, Fort Myers Beach Lions Foundation, Inc.
>> 
>> 
>> Retired (Lilly Engineering Fellow).
>> 
>> 
>>> On March 27, 2019 at 3:57 PM Paul Murrell 
>> wrote:
>>> 
>>> 
>>> 
>>> Are you looking for the contourLines() function ?
>>> 
>>> Paul
>>> 
>>>> On 28/03/19 8:37 AM, Bernard McGarvey wrote:
>>>> John, I have attached a pdf of the plot. Hopefully you can read this.
>>>> 
>>>> If I understand correctly, this plot is basically the 2-D version of the 
>>>> 1-D
>> quantile plot.
>>>> 
>>>> Thanks
>>>> 
>>>> Bernard McGarvey
>>>> 
>>>> 
>>>> Director, Fort Myers Beach Lions Foundation, Inc.
>>>> 
>>>> 
>>>> Retired (Lilly Engineering Fellow).
>>>> 
>>>> 
>>>>> On March 27, 2019 at 7:44 AM John Kane  wrote:
>>>>> 
>>>>> 
>>>>> The figure did not get  through. Perhaps try a pdf?
>>>>> 
>>>>> On Tue, 26 Mar 2019 at 13:41, Bernard McGarvey
>>>>>  wrote:
>>>>>> 
>>>>>> I want to see if I can reproduce the plot below in R. If I
>>>>>> understand it correctly, i takes my bivariate data and creates
>>>>>> quantile density contours. My interpretation of these contours is
>>>>>> that they enclose a certain % of the total data. I am using the
>>>>>> bkde2D function in library KernSmooth which gives density values
>>>>>> that can be plotted on a contour plot but I would like the curves
>>>>>> that enclose a given % of the data, if that is possible
>>>>>> 
>>>>>> 
>>>>>> Thanks
>>>>>> 
>>>>>> 
>>>>>> 
>>>>>> 
>>>>>> 
>>>>>> Bernard McGarvey
>>>>>> 
>>>>>> Director, Fort Myers Beach Lions Foundation, Inc.
>>>>>> 
>>>>>> Retired (Lilly Engineering Fellow).
>>>>>> 
>>>>>> 
>>>>>> __
>>>>>> R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
>>>>>> https://stat.ethz.ch/mailman/listinfo/r-help
>>>>>> PLEASE do read the posting guide
>>>>>> http://www.R-project.org/posting-guide.html
>>>>>> and provide commented, minimal, self-contained, reproducible code.
>>>>> 
>>>>> 
>>>>> 
>>>>> --
>>>>> John Kane
>>>>> Kingston ON Canada
>>>>> 
>>>>> __
>>>>> R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
>>>>> https://stat.ethz.ch/mailman/listinfo/r-help
>>>>> PLEASE do read the posting guide
>>>>> http://www.R-project.org/posting-guide.html
>>>

Re: [R] [FORGED] Re: Quantile Density Contours

2019-03-28 Thread Bernard McGarvey
pracma meets my needs - thanks - this is an amazing package with lots of very 
very useful functions. Thanks for bringing it to my attention.

Bernard McGarvey


Director, Fort Myers Beach Lions Foundation, Inc.


Retired (Lilly Engineering Fellow).


> On March 28, 2019 at 1:40 PM David Winsemius  wrote:
> 
> 
> 
> On 3/27/19 3:43 PM, Bernard Comcast wrote:
> > To follow on Jeff, is there a function to do 2-D (double) numerical 
> > integration in R?
> 
> Packages pracma and cubature offer a variety of solutions to that task.
> 
> 
> -- 
> 
> David.
> 
> 
> >
> > Bernard
> > Sent from my iPhone so please excuse the spelling!"
> >
> >> On Mar 27, 2019, at 6:38 PM, Jeff Newmiller  
> >> wrote:
> >>
> >> Regardless of how many dimensions you have for independent variables, the 
> >> density is one-dimensional, and if you assume the density function has 
> >> been determined (e.g. by kernel estimation or by a Gaussian copula) then 
> >> if you integrate the density function along that dimension there will be 
> >> unique slices of the multivariate input domain determined by those slices. 
> >> They might in general be disjoint regions of the independent variable 
> >> space, but that is what the contour function does.
> >>
> >> I am not seeing your point, Bert, unless you are unwilling to assume a 
> >> density function model?
> >>
> >>> On March 27, 2019 2:18:18 PM PDT, Bert Gunter  
> >>> wrote:
> >>> You are missing a crucial point. The reals are well ordered; higher
> >>> dimensions are not. Therefore 2d quantile contours are not unique.
> >>>
> >>> Of course assuming I understand your query correctly.
> >>>
> >>>
> >>> Bert
> >>>
> >>> On Wed, Mar 27, 2019, 13:55 Bernard McGarvey
> >>> 
> >>> wrote:
> >>>
> >>>> If I understand correctly the ContourLines function gives you the
> >>> contour
> >>>> lines when you put in the data. But before this I need to data to put
> >>> into
> >>>> that function. I think this is something like a 2D CDF of the data
> >>> that
> >>>> then leads to the 2D quantiles but I am not 100% sure. What I am
> >>> basically
> >>>> looking for is the 2D curve that encloses say 95% of the data in a
> >>> similar
> >>>> fashion to a 1D quantile where the quantile represents the value that
> >>> x% of
> >>>> the data is below. I think what I am looking for is the 2D bivariate
> >>>> version of the 1D quantile plot (where the quantile value is plotted
> >>> vs the
> >>>> % value).
> >>>>
> >>>> I hope this makes some sense.
> >>>>
> >>>> Bernard McGarvey
> >>>>
> >>>>
> >>>> Director, Fort Myers Beach Lions Foundation, Inc.
> >>>>
> >>>>
> >>>> Retired (Lilly Engineering Fellow).
> >>>>
> >>>>
> >>>>> On March 27, 2019 at 3:57 PM Paul Murrell
> >>> 
> >>>> wrote:
> >>>>>
> >>>>>
> >>>>> Are you looking for the contourLines() function ?
> >>>>>
> >>>>> Paul
> >>>>>
> >>>>>> On 28/03/19 8:37 AM, Bernard McGarvey wrote:
> >>>>>> John, I have attached a pdf of the plot. Hopefully you can read
> >>> this.
> >>>>>> If I understand correctly, this plot is basically the 2-D version
> >>> of
> >>>> the 1-D quantile plot.
> >>>>>> Thanks
> >>>>>>
> >>>>>> Bernard McGarvey
> >>>>>>
> >>>>>>
> >>>>>> Director, Fort Myers Beach Lions Foundation, Inc.
> >>>>>>
> >>>>>>
> >>>>>> Retired (Lilly Engineering Fellow).
> >>>>>>
> >>>>>>
> >>>>>>> On March 27, 2019 at 7:44 AM John Kane 
> >>> wrote:
> >>>>>>>
> >>>>>>> The figure did not get  through. Perhaps try a pdf?
> >>>>>>>
> >>>>>>> On Tue, 26 Mar 2019 at 13:41, Bernard McGarvey
> >>>>>>>  wrote:
> >>>>>>>> I want to see if I c

Re: [R] [FORGED] Re: Quantile Density Contours

2019-03-28 Thread Bernard Comcast
I will take a look but the hdrcde package appears to give me the plots I was 
looking for.

Thanks

Bernard
Sent from my iPhone so please excuse the spelling!"

> On Mar 28, 2019, at 10:16 PM, Jeff Newmiller  wrote:
> 
> I just found the "ks" package which looks promising... [1]
> 
> https://cran.r-project.org/web/packages/ks/vignettes/kde.pdf
> 
>> On March 28, 2019 12:16:12 PM PDT, David Winsemius  
>> wrote:
>> 
>>> On 3/28/19 11:33 AM, Bernard McGarvey wrote:
>>> pracma meets my needs - thanks - this is an amazing package with lots
>> of very very useful functions. Thanks for bringing it to my attention.
>> 
>> 
>> Excellent. I'll mention also the hdrcde package which addresses some of
>> 
>> your questions as well. It also has a "sliced" approach to disply of 2d
>> 
>> densities that I found informative and attractive.
> 
> -- 
> Sent from my phone. Please excuse my brevity.

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] Quantile Density Contours

2019-03-29 Thread Bernard Comcast
Thanks Abs - I was able to get the plot I needed with the hdrcde package but I 
will check out your package as well.

I continue to be impressed with the power Of R and the various packages 
available.

Thanks again


Bernard
Sent from my iPhone so please excuse the spelling!"

> On Mar 29, 2019, at 8:51 PM, Abs Spurdle  wrote:
> 
> My R package, "probhat", provides plots of bivariate PDFs and bivariate CDFs, 
> using kernel smoothing.
> Note that there is no bivariate quantile function, as such.
> 
> Here's the vignette:
> https://cran.r-project.org/web/packages/probhat/vignettes/probhat.pdf
> 
> This contains examples.
> 
> Note that I'm not subscribed to this mailing list.
> (Maybe I will subscribe).
> And I had difficulty reading the email addresses from the archive page.
> 

[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[R] R package to fit mixture or cure survival models

2009-05-13 Thread marc bernard

Dear All,
 
I am desperately trying to find any R package that fits a mixture survival 
models also know as a cure models. These  are survival models where the 
survival function is improper, which also means that  a fraction of subjects 
are expected not to expreience the event. A huge literature has been developed 
for these  type of models but I couldn't find any R package that fits them. 
 
Bests
 
Marc


_
[[elided Hotmail spam]]

[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[R] Mixture of survivals or cure models

2009-05-13 Thread marc bernard

Dear All,

 

I am desperately trying to find any R package that fits a mixture survival 
models also know as a cure models. This  are survival model where the survival 
function is improper  which also means that  a fraction of subjects are 
expected not to expreience the event. A Huge literature has been developed for 
thes type of models but I couldn't find any R package that fits this type of 
models. 

 

Bests

 

Marc

_


[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[R] problem with installing a local zip file : GFCURE

2009-05-19 Thread marc bernard

Dear all,

 

I am trying to install a package called "GFCURE" from a local zip file. This 
package fits a cure survival model and  has been downloaded from: 

http://post.queensu.ca/~pengp/software.html  

 

The problem is that when I try to install this package from a local zip file 
using R,  I've got the following error message:

 

Error in gzfile(file, "r") : cannot open the connection
In addition: Warning message:
In gzfile(file, "r") : cannot open compressed file 'gfcureWinR/DESCRIPTION', 
probable reason 'No such file or directory'

 

First, I thought it was an internal problem.  I then asked  some of my 
colleagues to do the same thing and they  had the same error message.

 

I would be very grateful if you can help me on that matter.

 

All the best

 

Marc


 

 

_
[[elided Hotmail spam]]

[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] problem with installing a local zip file : GFCURE

2009-05-19 Thread marc bernard

Dear gabor,

 

Many thanks for your answer. I indeed didn't check the read me text.

 

Bests

 


 
> From: ggrothendi...@gmail.com
> Date: Tue, 19 May 2009 08:44:13 -0400
> Subject: Re: [R] problem with installing a local zip file : GFCURE
> To: marc_bern...@hotmail.co.uk
> CC: r-help@r-project.org
> 
> On Tue, May 19, 2009 at 6:17 AM, marc bernard
>  wrote:
> >
> > Dear all,
> >
> >
> >
> > I am trying to install a package called "GFCURE" from a local zip file. 
> > This package fits a cure survival model and  has been downloaded from:
> >
> 
> You are assuming its in the form of an R *package* but its not.
> Unzip it and read the readme.txt file. If you still have problems
> contact the author.
> 
> > http://post.queensu.ca/~pengp/software.html
> >
> >
> >
> > The problem is that when I try to install this package from a local zip 
> > file using R,  I've got the following error message:
> >
> >
> >
> > Error in gzfile(file, "r") : cannot open the connection
> > In addition: Warning message:
> > In gzfile(file, "r") : cannot open compressed file 
> > 'gfcureWinR/DESCRIPTION', probable reason 'No such file or directory'
> >
> >
> >
> > First, I thought it was an internal problem.  I then asked  some of my 
> > colleagues to do the same thing and they  had the same error message.
> >
> >
> >
> > I would be very grateful if you can help me on that matter.
> >
> >
> >
> > All the best
> >
> >
> >
> > Marc
> >
> >
> >
> >
> >
> >
> > _
> > [[elided Hotmail spam]]
> >
> >[[alternative HTML version deleted]]
> >
> > __
> > R-help@r-project.org mailing list
> > https://stat.ethz.ch/mailman/listinfo/r-help
> > PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> > and provide commented, minimal, self-contained, reproducible code.
> >

_


[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] Inappropriate color name

2020-11-17 Thread Bernard Comcast
If the word Indian refers to India, the place of origin for the color, then 
referring to it by this name gives an acknowledgement to this fact and I would 
have assumed such acknowledgement  is a positive thing.

Bernard
Sent from my iPhone so please excuse the spelling!"

> On Nov 17, 2020, at 4:58 PM, Spencer Graves 
>  wrote:
> 
>   Might it be appropriate to raise that question on the Talk page 
> associated with the Wikipedia article on "Indian red (color)":
> 
> 
> https://en.wikipedia.org/wiki/Indian_red_(color)
> 
> 
>  Many Wikimedian are generally sympathetic to discussions of
> political correctness and similar topics.  If the name of that article were 
> changed, then it should be a lot easier to pursue a similar name change 
> elsewhere.
> 
> 
>  Spencer Graves
> 
> 
>> On 2020-11-17 15:25, Mitchell Maltenfort wrote:
>> What about just amputating the final "n?"
>> "Indian" might mean one of two things, but "India" is pretty distinct.
>>> On Tue, Nov 17, 2020 at 4:10 PM T. A. Milne via R-help 
>>> 
>>> wrote:
>>> 
>>> Apologies to the list for continuing a thread which is clearly off-topic.
>>> However, contacting the maintainer of an R package to complain about this
>>> specific color name seems ill-considered.
>>> 
>>> 1)  The name "indian red" is a part of widely-used color schemes
>>> everywhere, not just in R.  It's the color defined as:
>>> 
>>> "The color indianred / Indian red with hexadecimal color code #cd5c5c is a
>>> shade of red. In the RGB color model #cd5c5c is comprised of 80.39% red,
>>> 36.08% green and 36.08% blue. In the HSL color space #cd5c5c has a hue of
>>> 0° (degrees), 53% saturation and 58% lightness. This color has an
>>> approximate wavelength of 611.37 nm."
>>> 
>>> https://encycolorpedia.com/cd5c5c
>>> 
>>> 
>>> 2)  The "indian" in the color name refers to ferric oxide, historically
>>> sourced from India.  Per Wikipedia:
>>> 
>>> "The name Indian red derives from the red laterite soil found in India,
>>> which is composed of naturally occurring iron oxides.[citation needed] The
>>> first recorded use of Indian red as a color term in English was in 1672.[3"
>>> 
>>> https://en.wikipedia.org/wiki/Indian_red_(color)
>>> 
>>> 
>>> Given the name refers to the locus of the ferric oxide source, It isn't
>>> obvious that any particular group should be offended by the name.
>>> 
>>> 
>>> --  T. Arthur Milne
>>> 
>>> 
>>>> On Nov 16, 2020, at 5:46 PM, Rolf Turner 
>>> wrote:
>>>> 
>>>> On Tue, 17 Nov 2020 07:54:01 +1100
>>>> Jim Lemon  wrote:
>>>> 
>>>> 
>>>>> Hi Elaine,
>>>>> There seems to be a popular contest to discover offence everywhere. I
>>>>> don't think that it does anything against racism, sexism or
>>>>> antidisestablishmentarianism. Words are plucked from our vast lexicon
>>>>> to comfort or insult our fellows depending upon the intent of the
>>>>> user. It is the intent that matters, not the poor word. Chasing the
>>>>> words wastes your time, blames those who use the words harmlessly,
>>>>> and gives the real offender time to find another epithet.
>>>>> 
>>>> Jim:  This is superbly expressed.  I wish that I could have said
>>>> that! Your posting should go down in the annals of brilliant rhetoric,
>>>> alongside Dr. Johnson's "Letter to Lord Chesterfield".
>>>> 
>>>> cheers,
>>>> 
>>>> Rolf
>>>> 
>>> You know, I wouldn’t have continued this thread (which has now wandered
>>> off topic from the original somewhat-more-technical question), but I feel
>>> now like it’s necessary to do so (and only fair, if anyone is considering
>>> moderating me after letting these posts by):
>>> 
>>> That is a view commonly held by white people, and even more overwhelmingly
>>> by white men. Our field is already not as diverse as it should be for a
>>> variety of reasons, and this “pretending no one else on earth exists” kind
>>> of stuff is at least some part of the reason. The question at issue here
>>> aside, white men complaining about people finding racism or sexism
>>> everywhere they look doesn’t pass the sniff test. Most or all of these
&

[R] Summarizing select columns in a data frame

2021-01-17 Thread Bernard McGarvey
I have a data frame that consists of several factor columns say A, B, C, D, and 
E and several columns containing numerical data, say X1, X2,  X10. I would 
like to create statistics of some of the numerical columns by some of the 
factor columns. For example,

Calculate the mean, min, and max of variables X1 and X7, by factors A, and E. 
The results should look like the table below:

Factor A Factor E mean(X1) min(x1) max(X1) mean(X7) min(x7) max(X7) 
mean(X10) min(x10) max(X10)
A1E1
A1E2
A1E3
A2E1
A2E2
A2E3

I would like the results to be returned to a data frame or other object that I 
can write out using the write.csv function. I have looked at the summarize and 
numSummary functions but they do not appear to be flexible enough to do the 
above.

Any help would be appreciated,

Thanks

Bernard McGarvey
Director, Fort Myers Beach Lions Foundation, Inc.
Retired (Lilly Engineering Fellow).

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] Summarizing select columns in a data frame

2021-01-17 Thread Bernard Comcast
Thanks Bert

Bernard
Sent from my iPhone so please excuse the spelling!"

> On Jan 17, 2021, at 3:48 PM, Bert Gunter  wrote:
> 
> 
> There are literally tons of ways to do this sort of thing in R.
> 
> In base R ?tapply and friends, especially ?ave and ?by that may be close to 
> what you want.
> But there is a whole parallel universe -- the so-called "tidyverse set of 
> packages -- that many folks prefer.
> This link takes you down that rabbit hole: https://dplyr.tidyverse.org/
> 
> There are still others (e.g. the data.table package). You should expect to 
> invest a little time in learning whichever you choose. You may wish to also 
> search a bit for tutorials on your choice -- there are many good ones out 
> there.
> 
> 
> Bert Gunter
> 
> "The trouble with having an open mind is that people keep coming along and 
> sticking things into it."
> -- Opus (aka Berkeley Breathed in his "Bloom County" comic strip )
> 
> 
>> On Sun, Jan 17, 2021 at 12:18 PM Bernard McGarvey 
>>  wrote:
>> I have a data frame that consists of several factor columns say A, B, C, D, 
>> and E and several columns containing numerical data, say X1, X2,  X10. I 
>> would like to create statistics of some of the numerical columns by some of 
>> the factor columns. For example,
>> 
>> Calculate the mean, min, and max of variables X1 and X7, by factors A, and 
>> E. The results should look like the table below:
>> 
>> Factor A Factor E mean(X1) min(x1) max(X1) mean(X7) min(x7) max(X7) 
>> mean(X10) min(x10) max(X10)
>> A1E1
>> A1E2
>> A1E3
>> A2E1
>> A2E2
>> A2E3
>> 
>> I would like the results to be returned to a data frame or other object that 
>> I can write out using the write.csv function. I have looked at the summarize 
>> and numSummary functions but they do not appear to be flexible enough to do 
>> the above.
>> 
>> Any help would be appreciated,
>> 
>> Thanks
>> 
>> Bernard McGarvey
>> Director, Fort Myers Beach Lions Foundation, Inc.
>> Retired (Lilly Engineering Fellow).
>> 
>> __
>> R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
>> https://stat.ethz.ch/mailman/listinfo/r-help
>> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
>> and provide commented, minimal, self-contained, reproducible code.

[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] Summarizing select columns in a data frame

2021-01-17 Thread Bernard Comcast
Thanks David

Bernard
Sent from my iPhone so please excuse the spelling!"

> On Jan 17, 2021, at 5:59 PM, David Winsemius  wrote:
> 
> 
>> On 1/17/21 12:15 PM, Bernard McGarvey wrote:
>> I have a data frame that consists of several factor columns say A, B, C, D, 
>> and E and several columns containing numerical data, say X1, X2,  X10. I 
>> would like to create statistics of some of the numerical columns by some of 
>> the factor columns. For example,
>> 
>> Calculate the mean, min, and max of variables X1 and X7, by factors A, and 
>> E. The results should look like the table below:
>> 
>> Factor A Factor E mean(X1) min(x1) max(X1) mean(X7) min(x7) max(X7) 
>> mean(X10) min(x10) max(X10)
>> A1E1
>> A1E2
>> A1E3
>> A2E1
>> A2E2
>> A2E3
>> 
>> I would like the results to be returned to a data frame or other object that 
>> I can write out using the write.csv function. I have looked at the summarize 
>> and numSummary functions but they do not appear to be flexible enough to do 
>> the above.
> 
> 
> The `aggregate` function will do the subsetting and function application.
> 
> > dfrm <- cbind(dfrm, matrix(rnorm(600), ncol=10 ) ); names(dfrm)[3:12] <- 
> > paste0("X", 1:10)
> > str(dfrm)
> 'data.frame':60 obs. of  12 variables:
>  $ Factor_A: Factor w/ 2 levels "A1","A2": 1 1 1 2 2 2 1 1 1 2 ...
>  $ Factor_B: Factor w/ 3 levels "E1","E2","E3": 1 2 3 1 2 3 1 2 3 1 ...
>  $ X1  : num  -0.02116 -0.00049 0.12875 -0.05412 0.51886 ...
>  $ X2  : num  1.6799 -0.0963 -0.5727 -0.3638 -0.322 ...
>  $ X3  : num  -0.349 0.267 -0.666 -0.329 0.902 ...
>  $ X4  : num  0.1125 -0.5384 0.0924 0.6849 -0.4194 ...
>  $ X5  : num  -0.421 0.372 1.316 1.323 -0.03 ...
>  $ X6  : num  -0.0767 1.4972 0.1967 -0.7092 -1.0943 ...
>  $ X7  : num  0.1771 -0.2136 -1.0818 -0.0671 2.0015 ...
>  $ X8  : num  1.456 -0.383 -0.47 0.965 0.569 ...
>  $ X9  : num  -1.795 -0.4546 0.0069 1.2245 -0.395 ...
>  $ X10 : num  -1.931 1.708 0.274 0.73 -0.995 ...
> 
> 
> 
>  aggregate(  dfrm[ ,  c("X1", "X7", "X10")],# columns to analyze
> 
>   dfrm[ c("Factor_A", "Factor_B")],  # classifying columns
> 
>   FUN=function (x) c(mn =mean(x), min=min(x), max=max(x) 
> ) )  # desired "summarizers"
> 
> #--- result
> 
>   Factor_A Factor_BX1.mn   X1.min   X1.max X7.mn  X7.min  
> X7.max
> 1   A1   E1  0.187513792 -0.866094155  2.310960164 0.22489729 
> -0.91442493  1.94095786
> 2   A2   E1  0.078361707 -1.515410191  1.382420050 -0.51309155 
> -1.67026123  0.70869034
> 3   A1   E2 -0.267416858 -1.995131138  1.392115793 -0.04772929 
> -2.45426692  2.02225946
> 4   A2   E2 -0.069807208 -0.703073589  1.879448658 -0.37770923 
> -2.66221239  2.00152154
> 5   A1   E3 -0.007800886 -1.297561250  1.216627848 -0.30395411 
> -1.08181218  1.09764895
> 6   A2   E3 -0.054466856 -1.577891927  1.674719118 0.35594015 
> -1.20865279  2.25765422
>   X10.mnX10.minX10.max
> 1 -0.345 -2.0312811  1.1483179
> 2 -0.1021727 -1.3230372  0.8045472
> 3  0.3514645 -3.2334010  1.7075298
> 4 -0.4988984 -2.1091311  0.5857192
> 5  0.2297461 -1.1336967  0.8483935
> 
> 6  0.3700621 -1.5609424  2.2792024
> 
> 
> -- 
> 
> David
> 
>> 
>> Any help would be appreciated,
>> 
>> Thanks
>> 
>> Bernard McGarvey
>> Director, Fort Myers Beach Lions Foundation, Inc.
>> Retired (Lilly Engineering Fellow).
>> 
>> __
>> R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
>> https://stat.ethz.ch/mailman/listinfo/r-help
>> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
>> and provide commented, minimal, self-contained, reproducible code.

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[R] Col names in a data frame

2021-01-21 Thread Bernard McGarvey
Here is an example piece of code to illustrate an issue:

rm(list=ls()) # Clear Workspace
#
Data1 <- matrix(data=rnorm(9,0,1),nrow=3,ncol=3)
Colnames1 <- c("(A)","(B)","(C)")
colnames(Data1) <- Colnames1
print(Data1)
DataFrame1 <- data.frame(Data1)
print(DataFrame1)
colnames(DataFrame1) <- Colnames1
print(DataFrame1)

The results I get are:

(A)(B)(C)
[1,]  0.4739417  1.3138868  0.4262165
[2,] -2.1288083  1.0333770  1.1543404
[3,] -0.3401786 -0.7023236 -0.2336880
X.A.   X.B.   X.C.
1  0.4739417  1.3138868  0.4262165
2 -2.1288083  1.0333770  1.1543404
3 -0.3401786 -0.7023236 -0.2336880
 (A)(B)(C)
1  0.4739417  1.3138868  0.4262165
2 -2.1288083  1.0333770  1.1543404
3 -0.3401786 -0.7023236 -0.2336880

so that when I make the matrix with headings the parentheses are replaced by 
periods but I can add them after creating the data frame and the column 
headings are correct. 

Any ideas on why this occurs?

Thanks


Bernard McGarvey
Director, Fort Myers Beach Lions Foundation, Inc.
Retired (Lilly Engineering Fellow).

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] Col names in a data frame

2021-01-21 Thread Bernard Comcast
Thanks - I had seen that parameter but did not think the ( would be illegal but 
now I understand why it considers it illegal.

Thanks again

Bernard
Sent from my iPhone so please excuse the spelling!"

> On Jan 21, 2021, at 4:14 PM, Duncan Murdoch  wrote:
> 
> On 21/01/2021 3:58 p.m., Bernard McGarvey wrote:
>> Here is an example piece of code to illustrate an issue:
>> rm(list=ls()) # Clear Workspace
>> #
>> Data1 <- matrix(data=rnorm(9,0,1),nrow=3,ncol=3)
>> Colnames1 <- c("(A)","(B)","(C)")
>> colnames(Data1) <- Colnames1
>> print(Data1)
>> DataFrame1 <- data.frame(Data1)
>> print(DataFrame1)
>> colnames(DataFrame1) <- Colnames1
>> print(DataFrame1)
>> The results I get are:
>> (A)(B)(C)
>> [1,]  0.4739417  1.3138868  0.4262165
>> [2,] -2.1288083  1.0333770  1.1543404
>> [3,] -0.3401786 -0.7023236 -0.2336880
>> X.A.   X.B.   X.C.
>> 1  0.4739417  1.3138868  0.4262165
>> 2 -2.1288083  1.0333770  1.1543404
>> 3 -0.3401786 -0.7023236 -0.2336880
>>  (A)(B)(C)
>> 1  0.4739417  1.3138868  0.4262165
>> 2 -2.1288083  1.0333770  1.1543404
>> 3 -0.3401786 -0.7023236 -0.2336880
>> so that when I make the matrix with headings the parentheses are replaced by 
>> periods but I can add them after creating the data frame and the column 
>> headings are correct.
>> Any ideas on why this occurs?
> 
> By default, data.frame() uses names that are legal variable names, so you can 
> do things like Data1$X.A. You can stop this change by saying
> 
> DataFrame1 <- data.frame(Data1, check.names=FALSE)
> 
> Duncan Murdoch

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] Col names in a data frame

2021-01-21 Thread Bernard Comcast
Thanks - I had seen that parameter but did not think the ( would be illegal 
but now I understand why it considers it illegal.

Thanks again

Bernard
Sent from my iPhone so please excuse the spelling!"

> On Jan 21, 2021, at 4:14 PM, Duncan Murdoch  wrote:
> 
> On 21/01/2021 3:58 p.m., Bernard McGarvey wrote:
>> Here is an example piece of code to illustrate an issue:
>> rm(list=ls()) # Clear Workspace
>> #
>> Data1 <- matrix(data=rnorm(9,0,1),nrow=3,ncol=3)
>> Colnames1 <- c("(A)","(B)","(C)")
>> colnames(Data1) <- Colnames1
>> print(Data1)
>> DataFrame1 <- data.frame(Data1)
>> print(DataFrame1)
>> colnames(DataFrame1) <- Colnames1
>> print(DataFrame1)
>> The results I get are:
>>(A)(B)(C)
>> [1,]  0.4739417  1.3138868  0.4262165
>> [2,] -2.1288083  1.0333770  1.1543404
>> [3,] -0.3401786 -0.7023236 -0.2336880
>>X.A.   X.B.   X.C.
>> 1  0.4739417  1.3138868  0.4262165
>> 2 -2.1288083  1.0333770  1.1543404
>> 3 -0.3401786 -0.7023236 -0.2336880
>> (A)(B)(C)
>> 1  0.4739417  1.3138868  0.4262165
>> 2 -2.1288083  1.0333770  1.1543404
>> 3 -0.3401786 -0.7023236 -0.2336880
>> so that when I make the matrix with headings the parentheses are replaced by 
>> periods but I can add them after creating the data frame and the column 
>> headings are correct.
>> Any ideas on why this occurs?
> 
> By default, data.frame() uses names that are legal variable names, so you can 
> do things like Data1$X.A. You can stop this change by saying
> 
> DataFrame1 <- data.frame(Data1, check.names=FALSE)
> 
> Duncan Murdoch

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[R] Error loading "XLConnect" library

2021-04-14 Thread Bernard McGarvey
I installed the "XLConnect" package which appears to be successful and then 
tried to load the "XLConnect" library and got an error as shown below. Any 
ideas as to where to look for the source of the error? The word "release" in 
the error message makes me think it is some issue with the version of 
"XLConnect" but that is just a guess.

I am running the latest version of R available on CRAN on Windows 10.

> install.packages("XLConnect")
Installing package into ‘E:/Data/OneDrive/Documents/R/win-library/4.0’
(as ‘lib’ is unspecified)
trying URL 
'https://cran.rstudio.com/bin/windows/contrib/4.0/XLConnect_1.0.3.zip'
Content type 'application/zip' length 29498979 bytes (28.1 MB)
downloaded 28.1 MB
package ‘XLConnect’ successfully unpacked and MD5 sums checked
The downloaded binary packages are in
C:\Users\User\AppData\Local\Temp\RtmpARt8Er\downloaded_packages

> library(XLConnect)
Error: package or namespace load failed for ‘XLConnect’:
.onLoad failed in loadNamespace() for 'XLConnect', details:
call: system2("cat", c("/etc/*-release"), stdout = TRUE, stderr = TRUE)
error: '"cat"' not found

> library("XLConnect")
Error: package or namespace load failed for ‘XLConnect’:
.onLoad failed in loadNamespace() for 'XLConnect', details:
call: system2("cat", c("/etc/*-release"), stdout = TRUE, stderr = TRUE)
error: '"cat"' not found



Thanks



Bernard McGarvey

Director, Fort Myers Beach Lions Foundation, Inc.

Retired (Lilly Engineering Fellow).




[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] Error loading "XLConnect" library

2021-04-14 Thread Bernard Comcast
Thanks Marc

Bernard
Sent from my iPhone so please excuse the spelling!"

> On Apr 14, 2021, at 2:20 PM, Marc Schwartz  wrote:
> 
> Hi,
> 
> When you experience errors with a third party package like that, one of the 
> first steps to take is to review the results of CRAN testing on the package. 
> That is available via the "CRAN checks:" link on the package page:
> 
>  https://cran.r-project.org/web/packages/XLConnect/index.html
> 
> That link takes you to:
> 
>  https://cran.r-project.org/web/checks/check_results_XLConnect.html
> 
> where you can see that there are NOTEs and ERRORs being reported across 
> multiple platforms.
> 
> I would therefore contact the package maintainer and inquire as to the 
> current status of the package, plans to resolve the outstanding issues, and a 
> workaround in the mean time.
> 
> From a review of the Issues page on the package's Github site, there appear 
> to be a number of such reports already:
> 
>  https://github.com/miraisolutions/xlconnect/issues
> 
> So you may want to review those communications first.
> 
> Regards,
> 
> Marc Schwartz
> 
> 
> Bernard McGarvey wrote on 4/14/21 1:42 PM:
>> I installed the "XLConnect" package which appears to be successful and then 
>> tried to load the "XLConnect" library and got an error as shown below. Any 
>> ideas as to where to look for the source of the error? The word "release" in 
>> the error message makes me think it is some issue with the version of 
>> "XLConnect" but that is just a guess.
>> I am running the latest version of R available on CRAN on Windows 10.
>>> install.packages("XLConnect")
>> Installing package into ‘E:/Data/OneDrive/Documents/R/win-library/4.0’
>> (as ‘lib’ is unspecified)
>> trying URL 
>> 'https://cran.rstudio.com/bin/windows/contrib/4.0/XLConnect_1.0.3.zip'
>> Content type 'application/zip' length 29498979 bytes (28.1 MB)
>> downloaded 28.1 MB
>> package ‘XLConnect’ successfully unpacked and MD5 sums checked
>> The downloaded binary packages are in
>> C:\Users\User\AppData\Local\Temp\RtmpARt8Er\downloaded_packages
>>> library(XLConnect)
>> Error: package or namespace load failed for ‘XLConnect’:
>> .onLoad failed in loadNamespace() for 'XLConnect', details:
>> call: system2("cat", c("/etc/*-release"), stdout = TRUE, stderr = TRUE)
>> error: '"cat"' not found
>>> library("XLConnect")
>> Error: package or namespace load failed for ‘XLConnect’:
>> .onLoad failed in loadNamespace() for 'XLConnect', details:
>> call: system2("cat", c("/etc/*-release"), stdout = TRUE, stderr = TRUE)
>> error: '"cat"' not found
>> Thanks
>> Bernard McGarvey
>> Director, Fort Myers Beach Lions Foundation, Inc.
>> Retired (Lilly Engineering Fellow).
>>[[alternative HTML version deleted]]
>> __
>> R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
>> https://stat.ethz.ch/mailman/listinfo/r-help
>> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
>> and provide commented, minimal, self-contained, reproducible code.

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] Suggestions as to how to proceed would be appreciated...............

2022-05-22 Thread Bernard Comcast
Its simply a query to know what tools/packages R has for correlating single 
values with multivalued vectors. If that is outside the scope of the PG then so 
be it.

Bernard

Sent from my iPhone so please excuse the spelling!"

> On May 22, 2022, at 1:52 PM, Bert Gunter  wrote:
> 
> 
> Please read the posting guide(PG) inked below. Your query sounds more like a 
> project that requires a paid consultant; if so, this is way beyond the scope 
> of this list as described in the PG. So don't be too surprised if you don't 
> get a useful response, which this isn't either of course.
> 
> 
> Bert Gunter
> 
> "The trouble with having an open mind is that people keep coming along and 
> sticking things into it."
> -- Opus (aka Berkeley Breathed in his "Bloom County" comic strip )
> 
> 
>> On Sun, May 22, 2022 at 10:40 AM Bernard McGarvey 
>>  wrote:
>> I work in aspects of Cold Chain transportation in the pharmaceutical 
>> industry. These shippers are used to transport temperature sensitive 
>> products by surrounding the product load box with insulating materials of 
>> various sorts. The product temperature has lower and upper allowed limits so 
>> that when the product temperature hits one of these limits, the shipper 
>> fails and this failure time is teh shipper duration. If the shipper is 
>> exposed to very low or very high ambient temperatures during a shipment then 
>> we expect the duration of the shipper to be low.
>> 
>> The particular problem I am currently undertaking is to create a fast way to 
>> predict the duration of a shipping container when it is exposed to a given 
>> ambient temperature.
>> 
>> Currently we have the ability to predict such durations using a calibrated 
>> 3D model (typically a finite element or finite volume transient 
>> representation of the heat transfer equations). These models can predict the 
>> temperature of the pharmaceutical product within the shipper over time as it 
>> is exposed to an external ambient temperature profile. .
>> 
>> The problem with the 3D model is that it takes significant CPU time and the 
>> software is specialized. What I would like to do is to be able to enter the 
>> ambient profile into a spreadsheet and then be able to predict the expected 
>> duration of the shipper using a simple calculation that can be implemented 
>> in the spreadsheet environment. The idea I had was as follows:
>> 
>> 1. Create a selection of ambient temperature profiles covering a wide range 
>> of ambient behavior. Ensure the profiles are long enough so that the shipper 
>> is sure to fail at some time during the ambient profile.
>> 
>> 2. Use the 3D model to predict the shipper duration for the selection of 
>> ambient temperature profiles in (1). Each ambient temperature will have its 
>> own duration.
>> 
>> 3. Since only the ambient temperatures up to the duration time are relevant, 
>> truncate each ambient profile for times greater than the duration.
>> 
>> 4. Step (3) means that the ambient temperature profiles will have different 
>> lengths corresponding to the different durations.
>> 
>> 5. Use the truncated ambient profiles and their corresponding durations to 
>> build some type of empirical model relating the duration to the 
>> corresponding ambient profile.
>> 
>> Some other notes:
>> 
>> a. We know from our understanding of how the shippers are constructed and 
>> the laws of heat transfer that some sections of the ambient profile will 
>> have more of an impact on determining the duration that other sections.
>> b. Just correlating the duration with the average temperature of the profile 
>> can predict the duration for that profile to within 10-15%. We are looking 
>> for the ability to get within 2% of the shipper duration predicted by the 3D 
>> model.
>> 
>> What I am looking for is suggestions as to how to approach step (5) with 
>> tools/packages available in R.
>> 
>> Thanks in advance
>> 
>> Bernard McGarvey, Ph.D.
>> 
>> Technical Advisor
>> Parenteral Supply Chain LLC
>> 
>> bernard.first.princip...@gmail.com mailto:bernard.first.princip...@gmail.com
>> 
>> (317) 627-4025
>> 
>> 
>> 
>> [[alternative HTML version deleted]]
>> 
>> __
>> R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
>> https://stat.ethz.ch/mailman/listinfo/r-help
>> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
>> and provide commented, minimal, self-contained, reproducible code.

[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] Pause script at input from terminal (interactive use)

2019-04-19 Thread Bernard Comcast
I have used the shiny package to create a web page user interface and it works 
well.

Bernard
Sent from my iPhone so please excuse the spelling!"

> On Apr 19, 2019, at 1:12 AM, Luigi Marongiu  wrote:
> 
> I am realizing as well that R is not the best option for an
> interactive session. I changed the script to get the input from a
> config file; it is less elegant because the procedure now requires
> double the files than with CLI input, but at the end of the day is
> more practical when most of the answer remains the same between
> sessions. Thanks.
> 
>> On Thu, Apr 18, 2019 at 8:47 PM Greg Snow <538...@gmail.com> wrote:
>> 
>> I am not an expert on Rscript, but I don't think that an actual
>> terminal is ever used when using Rscript.  And `interactive()` will
>> probably always be false.
>> 
>> So if you want the script to pause for input, you need to have some
>> form of user interface to work with.
>> 
>> One option is to use the tcltk package (this works on all OS's to my
>> knowledge, but not if you are accessing the computer remotely).  This
>> answer on stack overflow shows some code that may help:
>> https://stackoverflow.com/questions/16847621/get-data-out-of-a-tcltk-function/16847918#16847918
>> 
>> 
>>> On Thu, Apr 18, 2019 at 8:11 AM Luigi Marongiu  
>>> wrote:
>>> 
>>> Dear all,
>>> I am trying to write an interactive script where the user type some
>>> input from the terminal. I used readline() but when I launch the file
>>> with Rscript, the function is overwritten directly, there is no
>>> waiting for the user's input. For instance, this example:
>>> 
>>> VAR1 = as.numeric(readline(prompt = "Enter something -> "))
>>> VAR2 = as.numeric(readline(prompt = "Enter something else -> "))
>>> if(is.na(VAR1)) VAR1 = 0
>>> if(is.na(VAR2)) VAR2 = "empty"
>>> cat("Input was: ", VAR1, " - ", VAR2, "\n")
>>> 
>>> is executed till the end without typing anything on terminal :
>>> 
>>> $ Rscript test.R
>>> Enter something ->
>>> Enter something else ->
>>> Input was:  0  -  empty
>>> 
>>> I also tried with ',1' at the end of readline, but the effect is the
>>> same. I should use the interactive() function but I am confused on its
>>> use.
>>> It is possible to launch R scritps in the interactive mode in the
>>> first place? and if yes, how? Or would python or julia be better
>>> choices in this case?
>>> Thank you.
>>> --
>>> Best regards,
>>> Luigi
>>> 
>>> __
>>> R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
>>> https://stat.ethz.ch/mailman/listinfo/r-help
>>> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
>>> and provide commented, minimal, self-contained, reproducible code.
>> 
>> 
>> 
>> --
>> Gregory (Greg) L. Snow Ph.D.
>> 538...@gmail.com
> 
> 
> 
> -- 
> Best regards,
> Luigi
> 
> __
> R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[R] Surface plots....

2019-04-25 Thread Bernard Comcast
Does anyone have a recommendation for the best package/function for doing 
surface plots?

Bernard
Sent from my iPhone so please excuse the spelling!"
__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] Surface plots....

2019-04-25 Thread Bernard McGarvey
If I have a set of data (x,y,z) and I want to plot z(x,y) as a surface plot. 
What I am looking for is one with a lot of functionality like easily rotate the 
plot and so on.


Thanks



Bernard McGarvey

Director, Fort Myers Beach Lions Foundation, Inc.

Retired (Lilly Engineering Fellow).



> On April 25, 2019 at 2:13 PM Bert Gunter  wrote:
> 
> Depends on what you want to do -- context matters.
> More details would probably enable better answers.
> 
> Bert Gunter
> 
> "The trouble with having an open mind is that people keep coming along 
> and sticking things into it."
> -- Opus (aka Berkeley Breathed in his "Bloom County" comic strip )
> 
> 
> On Thu, Apr 25, 2019 at 10:55 AM Bernard Comcast < 
> mcgarvey.bern...@comcast.net mailto:mcgarvey.bern...@comcast.net > wrote:
> 
> > > Does anyone have a recommendation for the best package/function 
> for doing surface plots?
> > 
> > Bernard
> > Sent from my iPhone so please excuse the spelling!"
> > __
> > R-help@r-project.org mailto:R-help@r-project.org mailing list -- To 
> > UNSUBSCRIBE and more, see
> > https://stat.ethz.ch/mailman/listinfo/r-help
> > PLEASE do read the posting guide 
> > http://www.R-project.org/posting-guide.html
> > and provide commented, minimal, self-contained, reproducible code.
> > 
> > > 

[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] Surface plots....

2019-04-25 Thread Bernard Comcast
That works nicely for what I need
Thanks

Bernard
Sent from my iPhone so please excuse the spelling!"

> On Apr 25, 2019, at 3:21 PM, Duncan Murdoch  wrote:
> 
>> On 25/04/2019 2:24 p.m., Bernard McGarvey wrote:
>> If I have a set of data (x,y,z) and I want to plot z(x,y) as a surface plot. 
>> What I am looking for is one with a lot of functionality like easily rotate 
>> the plot and so on.
> 
> If x and y are on a grid, there are lots of choices.  If they are a set of 
> irregular points, there aren't so many.  One possibility is to use persp3d(z 
> ~ x + y) (see ?persp3d.formula for help.)  Use rglwidget() to write it in a 
> form you can view in a web browser.
> 
> Duncan Murdoch
> 
>> Thanks
>> Bernard McGarvey
>> Director, Fort Myers Beach Lions Foundation, Inc.
>> Retired (Lilly Engineering Fellow).
>>> On April 25, 2019 at 2:13 PM Bert Gunter  wrote:
>>> 
>>> Depends on what you want to do -- context matters.
>>> More details would probably enable better answers.
>>> 
>>> Bert Gunter
>>> 
>>> "The trouble with having an open mind is that people keep coming along 
>>> and sticking things into it."
>>> -- Opus (aka Berkeley Breathed in his "Bloom County" comic strip )
>>> 
>>> 
>>> On Thu, Apr 25, 2019 at 10:55 AM Bernard Comcast < 
>>> mcgarvey.bern...@comcast.net mailto:mcgarvey.bern...@comcast.net > wrote:
>>> 
>>> > > Does anyone have a recommendation for the best package/function 
>>> for doing surface plots?
>>>> 
>>>> Bernard
>>>> Sent from my iPhone so please excuse the spelling!"
>>>> __
>>>> R-help@r-project.org mailto:R-help@r-project.org mailing list -- 
>>>> To UNSUBSCRIBE and more, see
>>>> https://stat.ethz.ch/mailman/listinfo/r-help
>>>> PLEASE do read the posting guide 
>>>> http://www.R-project.org/posting-guide.html
>>>> and provide commented, minimal, self-contained, reproducible code.
>>>> 
>>>> >
>>[[alternative HTML version deleted]]
>> __
>> R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
>> https://stat.ethz.ch/mailman/listinfo/r-help
>> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
>> and provide commented, minimal, self-contained, reproducible code.
> 

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[R] Curve fitting

2020-04-05 Thread Bernard Comcast
Any recommendations on an R package to fit data to a nonlinear model Y=f(x) 
with a single x and y variable? 

I want to be able to generate parameter uncertainty estimates and prediction 
uncertainties if possible.

Bernard
Sent from my iPhone so please excuse the spelling!"
__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] Curve fitting

2020-04-05 Thread Bernard Comcast
Thanks Jeff

Bernard
Sent from my iPhone so please excuse the spelling!"

> On Apr 5, 2020, at 3:14 PM, Jeff Newmiller  wrote:
> 
> stats::nlm?
> 
>> On April 5, 2020 11:53:10 AM PDT, Bernard Comcast 
>>  wrote:
>> Any recommendations on an R package to fit data to a nonlinear model
>> Y=f(x) with a single x and y variable? 
>> 
>> I want to be able to generate parameter uncertainty estimates and
>> prediction uncertainties if possible.
>> 
>> Bernard
>> Sent from my iPhone so please excuse the spelling!"
>> __
>> R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
>> https://stat.ethz.ch/mailman/listinfo/r-help
>> PLEASE do read the posting guide
>> http://www.R-project.org/posting-guide.html
>> and provide commented, minimal, self-contained, reproducible code.
> 
> -- 
> Sent from my phone. Please excuse my brevity.

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[R] Correlated sampling

2020-04-09 Thread Bernard Comcast
I want to create a Monte Carlo simulation with 4 input parameters that are 
correlated with each other. The parameters have normal distributions and the 
variance/covariance matrix is known. Are there any R functions available to 
generate such correlated normal random variables?

Bernard
Sent from my iPhone so please excuse the spelling!"
__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[R] Interactive stats packages

2020-04-16 Thread Bernard Comcast
Do any of you know of any interactive stats analysis packages built on top of R?

Bernard
Sent from my iPhone so please excuse the spelling!"
__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] Interactive stats packages

2020-04-16 Thread Bernard Comcast
Yes Ista, that is what I meant by interactive. Something that is menu driven 
with a GUI rather than command line.

Thanks

Bernard
Sent from my iPhone so please excuse the spelling!"

> On Apr 16, 2020, at 5:44 PM, Ista Zahn  wrote:
> 
> On Thu, Apr 16, 2020 at 4:48 PM Bernard Comcast
>  wrote:
>> 
>> Do any of you know of any interactive stats analysis packages built on top 
>> of R?
> 
> R _is_ an interactive stats package, please be more specific :-)
> 
> Maybe you mean something like https://dreamrs.github.io/esquisse/index.html
> 
> Best,
> Ista
> 
>> 
>> Bernard
>> Sent from my iPhone so please excuse the spelling!"
>> __
>> R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
>> https://stat.ethz.ch/mailman/listinfo/r-help
>> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
>> and provide commented, minimal, self-contained, reproducible code.

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] Interactive stats packages

2020-04-16 Thread Bernard Comcast
Thanks

Bernard
Sent from my iPhone so please excuse the spelling!"

> On Apr 16, 2020, at 6:10 PM, Bert Gunter  wrote:
> 
> In addition ...
> 
> https://cran.r-project.org/web/views/TeachingStatistics.html
> 
> Bert Gunter
> 
> "The trouble with having an open mind is that people keep coming along
> and sticking things into it."
> -- Opus (aka Berkeley Breathed in his "Bloom County" comic strip )
> 
>> On Thu, Apr 16, 2020 at 2:44 PM Ista Zahn  wrote:
>> 
>>> On Thu, Apr 16, 2020 at 4:48 PM Bernard Comcast
>>>  wrote:
>>> 
>>> Do any of you know of any interactive stats analysis packages built on top 
>>> of R?
>> 
>> R _is_ an interactive stats package, please be more specific :-)
>> 
>> Maybe you mean something like https://dreamrs.github.io/esquisse/index.html
>> 
>> Best,
>> Ista
>> 
>>> 
>>> Bernard
>>> Sent from my iPhone so please excuse the spelling!"
>>> __
>>> R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
>>> https://stat.ethz.ch/mailman/listinfo/r-help
>>> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
>>> and provide commented, minimal, self-contained, reproducible code.
>> 
>> __
>> R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
>> https://stat.ethz.ch/mailman/listinfo/r-help
>> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
>> and provide commented, minimal, self-contained, reproducible code.

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] Interactive stats packages

2020-04-16 Thread Bernard Comcast
Thanks

Bernard
Sent from my iPhone so please excuse the spelling!"

> On Apr 16, 2020, at 9:01 PM, Ista Zahn  wrote:
> 
> On Thu, Apr 16, 2020 at 8:05 PM Bernard Comcast
>  wrote:
>> 
>> Yes Ista, that is what I meant by interactive. Something that is menu driven 
>> with a GUI rather than command line.
> 
> There are several. I'm aware of these
> 
> https://jasp-stats.org/
> https://socialsciences.mcmaster.ca/jfox/Misc/Rcmdr/
> http://www.deducer.org/pmwiki/pmwiki.php?n=Main.DeducerManual
> 
> There are undoubtedly others.
> 
> --Ista
> 
> 
>> 
>> Thanks
>> 
>> Bernard
>> Sent from my iPhone so please excuse the spelling!"
>> 
>>>> On Apr 16, 2020, at 5:44 PM, Ista Zahn  wrote:
>>> 
>>> On Thu, Apr 16, 2020 at 4:48 PM Bernard Comcast
>>>  wrote:
>>>> 
>>>> Do any of you know of any interactive stats analysis packages built on top 
>>>> of R?
>>> 
>>> R _is_ an interactive stats package, please be more specific :-)
>>> 
>>> Maybe you mean something like https://dreamrs.github.io/esquisse/index.html
>>> 
>>> Best,
>>> Ista
>>> 
>>>> 
>>>> Bernard
>>>> Sent from my iPhone so please excuse the spelling!"
>>>> __
>>>> R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
>>>> https://stat.ethz.ch/mailman/listinfo/r-help
>>>> PLEASE do read the posting guide 
>>>> http://www.R-project.org/posting-guide.html
>>>> and provide commented, minimal, self-contained, reproducible code.
>> 

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[R] COVID-19 datasets...

2020-05-04 Thread Bernard McGarvey
Just curious does anyone know of a website that has data available in a format 
that R can download and analyze?
 
Thanks


Bernard McGarvey


Director, Fort Myers Beach Lions Foundation, Inc.


Retired (Lilly Engineering Fellow).

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] COVID-19 datasets...

2020-05-04 Thread Bernard Comcast
Thanks, i will take a look

Bernard
Sent from my iPhone so please excuse the spelling!"

> On May 4, 2020, at 2:49 PM, James Spottiswoode  wrote:
> 
> Sure. COVID-19 Data Repository by the Center for Systems Science and 
> Engineering (CSSE) at Johns Hopkins University is available here:
> 
> https://github.com/CSSEGISandData/COVID-19
> 
> All in csv fiormat.
> 
> 
>> On May 4, 2020, at 11:31 AM, Bernard McGarvey  
>> wrote:
>> 
>> Just curious does anyone know of a website that has data available in a 
>> format that R can download and analyze?
>>  
>> Thanks
>> 
>> 
>> Bernard McGarvey
>> 
>> 
>> Director, Fort Myers Beach Lions Foundation, Inc.
>> 
>> 
>> Retired (Lilly Engineering Fellow).
>> 
>> __
>> R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
>> https://stat.ethz.ch/mailman/listinfo/r-help
>> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
>> and provide commented, minimal, self-contained, reproducible code.
>> 
> 
> James Spottiswoode
> Applied Mathematics & Statistics
> (310) 270 6220
> jamesspottiswoode Skype
> ja...@jsasoc.com
> 
> 
> 

[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] unstable results of nlxb fit

2020-05-07 Thread Bernard McGarvey
+00  6.8321e+00  -16.405584  2.6139e-02
 [56,] 3359.2  1.2687e+03  6.8321e+00   -3.775998  2.6139e-02
 [57,] 3359.2  1.5529e+01 -8.6967e+000.026139  2.6139e-02
 [58,] 3359.2 -1.0003e+01  1.6835e+010.026139  2.6139e-02
 [59,] 3359.2  6.8321e+00  3.9291e+020.026139 -4.1974e+02
 [60,] 3359.2 -2.1880e+01  2.8712e+010.026139  2.6139e-02
 [61,] 3359.2  4.1736e+03  6.8321e+00  -10.711457  2.6139e-02
 [62,] 3359.2 -3.3185e+01  4.0017e+010.026139  2.6139e-02
 [63,] 3359.2  7.6732e+02  6.8321e+00   -0.723977  2.6139e-02
 [64,] 3359.2  1.5334e+04  6.8321e+00  -52.573620  2.6139e-02
 [65,] 3359.2 -2.9556e+01  3.6388e+010.026139  2.6139e-02
 [66,] 3359.2 -1.0447e+00  7.8767e+000.026139  2.6139e-02
 [67,] 3359.2  6.8321e+00  2.1471e+020.026139 -7.0582e+01
 [68,]  417.8  9.7727e+00  3.9452e-130.021798  2.8023e-01
 [69,] 3359.2 -2.2293e+01  2.9126e+010.026139  2.6139e-02
 [70,] 3359.2  6.2259e+02  6.8321e+00   -2.782527  2.6139e-02
 [71,] 3359.2 -1.4639e+01  2.1471e+010.026139  2.6139e-02
 [72,]  417.8  3.9452e-13  9.7727e+000.280227  2.1798e-02
 [73,]  417.8  3.9452e-13  9.7727e+000.280227  2.1798e-02
 [74,]  417.8  3.9452e-13  9.7727e+000.280227  2.1798e-02
 [75,] 3359.2 -2.3449e+01  3.0281e+010.026139  2.6139e-02
 [76,] 3359.2 -2.5926e+01  6.8321e+00   -0.663656  2.6139e-02
 [77,]  417.8  9.7727e+00  3.9452e-130.021798  2.8023e-01
 [78,] 3359.2  6.8321e+00  6.9426e+020.026139 -1.9442e+00
 [79,] 3359.2  2.8684e+02  6.8321e+00   -0.854394  2.6139e-02
 [80,]  417.8  3.9452e-13  9.7727e+000.280227  2.1798e-02
 [81,] 3359.2 -4.5066e+01  5.1899e+010.026139  2.6139e-02
 [82,] 3359.2  4.4678e+03  6.8321e+00   -2.109446  2.6139e-02
 [83,] 3359.2  3.1376e+03  6.8321e+00   -1.104803  2.6139e-02
 [84,] 3359.2  6.8321e+00  1.1167e+020.026139 -1.0280e+00
 [85,]  417.8  3.9452e-13  9.7727e+000.280227  2.1798e-02
 [86,] 3359.2  5.3864e+02  6.8321e+00   -0.657971  2.6139e-02
 [87,] 3359.2  4.8227e+01  6.8321e+00   -2.304024  2.6139e-02
 [88,] 3359.2 -2.2048e+01  2.8880e+010.026139  2.6139e-02
 [89,]  417.8  3.9452e-13  9.7727e+000.280227  2.1798e-02
 [90,] 3359.2  6.8321e+00 -4.1689e+010.026139 -3.6049e+00
 [91,]  417.8  9.7727e+00  3.9452e-130.021798  2.8023e-01
 [92,] 3359.2 -4.1265e+01  4.8097e+010.026139  2.6139e-02
 [93,] 3359.2 -1.1565e+01  1.8397e+010.026139  2.6139e-02
 [94,] 3359.2  2.3698e+01 -1.6866e+010.026139  2.6139e-02
 [95,] 3359.2  4.4700e+03  6.8321e+00  -12.836180  2.6139e-02
 [96,] 3359.2  4.6052e+04  6.8321e+00   -7.158584  2.6139e-02
 [97,] 3359.2  2.5464e+03  6.8321e+00   -1.811626  2.6139e-02
 [98,] 3359.2  6.8321e+00  1.0338e+030.026139 -1.5365e+01
 [99,] 3359.2  1.3783e+01 -6.9507e+000.026139  2.6139e-02
[100,] 3359.2  6.8321e+00  6.7153e+020.026139 -1.5975e+03


Hope this helps,

Bernard McGarvey


Director, Fort Myers Beach Lions Foundation, Inc.


Retired (Lilly Engineering Fellow).

> On May 7, 2020 at 9:33 AM J C Nash  wrote:
> 
> 
> The double exponential is well-known as a disaster to fit. Lanczos in his
> 1956 book Applied Analysis, p. 276 gives a good example which is worked 
> through.
> I've included it with scripts using nlxb in my 2014 book on Nonlinear 
> Parameter
> Optimization Using R Tools (Wiley). The scripts were on Wiley's site for the 
> book,
> but I've had difficulty getting Wiley to fix things and not checked lately if 
> it
> is still accessible. Ask off-list if you want the script and I'll dig into my
> archives.
> 
> nlxb (preferably from nlsr which you used rather than nlmrt which is now not
> maintained), will likely do as well as any general purpose code. There may be
> special approaches that do a bit better, but I suspect the reality is that
> the underlying problem is such that there are many sets of parameters with
> widely different values that will get quite similar sums of squares.
> 
> Best, JN
> 
> 
> On 2020-05-07 9:12 a.m., PIKAL Petr wrote:
> > Dear all
> > 
> > I started to use nlxb instead of nls to get rid of singular gradient error.
> > I try to fit double exponential function to my data, but results I obtain
> > are strongly dependent on starting values. 
> > 
> > tsmes ~ A*exp(a*plast) + B* exp(b*plast)
> > 
> > Changing b from 0.1 to 0.01 gives me completely different results. I usually
> > check result by a plot but could the result be inspected if it achieved good
> > result without plotting?
> > 
> > Or is there any way how to perform such task?
> > 
> > Cheers
> > Petr
> > 
> > Below is working example.
> > 
> >> dput(temp)
> > temp <- structure(list(tsmes = c(31, 32, 32, 32, 32, 32, 32, 32, 33, 
> > 34, 35, 35, 36, 36, 36, 37, 38, 39, 40, 40, 40, 40, 40, 41, 43, 
> > 44, 44, 44, 46, 47, 47, 47, 47, 48,

Re: [R] Fitting Richards' curve

2020-05-13 Thread Bernard Comcast
John, have you ever looked at interval optimization as an alternative since it 
can lead to provably global minima?

Bernard
Sent from my iPhone so please excuse the spelling!"

> On May 13, 2020, at 8:42 AM, J C Nash  wrote:
> 
> The Richards' curve is analytic, so nlsr::nlxb() should work better than 
> nls() for getting derivatives --
> the dreaded "singular gradient" error will likely stop nls(). Also likely, 
> since even a 3-parameter
> logistic can suffer from it (my long-standing Hobbs weed infestation problem 
> below), is
> that the Jacobian will be near-singular. And badly scaled. Nonlinear fitting 
> problems essentially
> have different scale in different portions of the parameter space.
> 
> You may also want to "fix" or mask one or more parameters to reduce the 
> dimensionality of the problem,
> and nlsr::nlxb() can do that.
> 
> The Hobbs problem has the following 12 data values for time points 1:12
> 
> # Data for Hobbs problem
> ydat  <-  c(5.308, 7.24, 9.638, 12.866, 17.069, 23.192, 31.443,
>  38.558, 50.156, 62.948, 75.995, 91.972) # for testing
> tdat  <-  seq_along(ydat) # for testing
> 
> An unscaled model is
> 
> eunsc  <-   y ~ b1/(1+b2*exp(-b3*tt))
> 
> This problem looks simple, but has given lots of software grief over nearly 5 
> decades. In 1974 an
> extensive search had all commonly available software failing, which led to 
> the code that evolved
> into nlsr, though there are plenty of cases where really awful code will 
> luckily find a good
> solution. The issue is getting a solution and knowing it is reasonable. I 
> suspect a Richards'
> model will be more difficult unless the OP has a lot of data and maybe some 
> external information
> to fix or constrain some parameters.
> 
> JN
> 
> 
>> On 2020-05-13 5:41 a.m., Peter Dalgaard wrote:
>> Shouldn't be hard to set up with nls(). (I kind of suspect that the Richards 
>> curve has more flexibility than data can resolve, especially the subset 
>> (Q,B,nu) seems highly related, but hey, it's your data...)
>> 
>> -pd 
>> 
>>>> On 13 May 2020, at 11:26 , Christofer Bogaso  
>>>> wrote:
>>> 
>>> Hi,
>>> 
>>> Is there any R package to fit Richards' curve in the form of
>>> https://en.wikipedia.org/wiki/Generalised_logistic_function
>>> 
>>> I found there is one package grofit, but currently defunct.
>>> 
>>> Any pointer appreciated.
>>> 
>>> __
>>> R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
>>> https://stat.ethz.ch/mailman/listinfo/r-help
>>> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
>>> and provide commented, minimal, self-contained, reproducible code.
>> 
> 
> __
> R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] Fitting Richards' curve

2020-05-13 Thread Bernard Comcast
Also, in the full curve referenced on Wikpedia, the parameters Q And M are 
confounded - you only need one or the other But not both. If you are using both 
and trying to estimate them both you will have problems.

I have fitted these curves quite easily using the Solver in Excel.

Bernard
Sent from my iPhone so please excuse the spelling!"

> On May 13, 2020, at 8:42 AM, J C Nash  wrote:
> 
> The Richards' curve is analytic, so nlsr::nlxb() should work better than 
> nls() for getting derivatives --
> the dreaded "singular gradient" error will likely stop nls(). Also likely, 
> since even a 3-parameter
> logistic can suffer from it (my long-standing Hobbs weed infestation problem 
> below), is
> that the Jacobian will be near-singular. And badly scaled. Nonlinear fitting 
> problems essentially
> have different scale in different portions of the parameter space.
> 
> You may also want to "fix" or mask one or more parameters to reduce the 
> dimensionality of the problem,
> and nlsr::nlxb() can do that.
> 
> The Hobbs problem has the following 12 data values for time points 1:12
> 
> # Data for Hobbs problem
> ydat  <-  c(5.308, 7.24, 9.638, 12.866, 17.069, 23.192, 31.443,
>  38.558, 50.156, 62.948, 75.995, 91.972) # for testing
> tdat  <-  seq_along(ydat) # for testing
> 
> An unscaled model is
> 
> eunsc  <-   y ~ b1/(1+b2*exp(-b3*tt))
> 
> This problem looks simple, but has given lots of software grief over nearly 5 
> decades. In 1974 an
> extensive search had all commonly available software failing, which led to 
> the code that evolved
> into nlsr, though there are plenty of cases where really awful code will 
> luckily find a good
> solution. The issue is getting a solution and knowing it is reasonable. I 
> suspect a Richards'
> model will be more difficult unless the OP has a lot of data and maybe some 
> external information
> to fix or constrain some parameters.
> 
> JN
> 
> 
>> On 2020-05-13 5:41 a.m., Peter Dalgaard wrote:
>> Shouldn't be hard to set up with nls(). (I kind of suspect that the Richards 
>> curve has more flexibility than data can resolve, especially the subset 
>> (Q,B,nu) seems highly related, but hey, it's your data...)
>> 
>> -pd 
>> 
>>>> On 13 May 2020, at 11:26 , Christofer Bogaso  
>>>> wrote:
>>> 
>>> Hi,
>>> 
>>> Is there any R package to fit Richards' curve in the form of
>>> https://en.wikipedia.org/wiki/Generalised_logistic_function
>>> 
>>> I found there is one package grofit, but currently defunct.
>>> 
>>> Any pointer appreciated.
>>> 
>>> __
>>> R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
>>> https://stat.ethz.ch/mailman/listinfo/r-help
>>> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
>>> and provide commented, minimal, self-contained, reproducible code.
>> 
> 
> __
> R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] Fitting Richards' curve

2020-05-13 Thread Bernard Comcast
I have been using nlsr() to fit s curves to Covid-19 data over the past few 
weeks and I have not had any issues.

Bernard
Sent from my iPhone so please excuse the spelling!"

> On May 13, 2020, at 5:16 PM, Abby Spurdle  wrote:
> 
> Hi Christofer,
> 
> This doesn't really answer your question.
> But if the goal is to fit an S-shaped curve to data, with increased
> flexibility...
> (I'm assuming that's the goal).
> 
> ...then I'd like to note the option of splines (or smoothing), subject
> to shape constraints...
> 
> My guess, is it's probably easier to model the inverse of a growth
> curve this way, than to model the growth curve directly.
> In which case, a 4-piece to 10-piece spline should give considerably flexibly.
> 
> It's possible that Martin's package, cobs, can do this, but not sure,
> I haven't tried it.
> And there may be other R packages for fitting splines/smoothers to
> data, subject to shape constraints.
> 
> If not, I'm guessing it wouldn't be too difficult to implement, via
> extensions to the quadprog package, for quadratic programming.
> 
> 
>> On Wed, May 13, 2020 at 9:26 PM Christofer Bogaso
>>  wrote:
>> 
>> Hi,
>> 
>> Is there any R package to fit Richards' curve in the form of
>> https://en.wikipedia.org/wiki/Generalised_logistic_function
>> 
>> I found there is one package grofit, but currently defunct.
>> 
>> Any pointer appreciated.
>> 
>> __
>> R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
>> https://stat.ethz.ch/mailman/listinfo/r-help
>> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
>> and provide commented, minimal, self-contained, reproducible code.
> 
> __
> R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[R] Plotting shipment routs on a world map

2020-05-27 Thread Bernard McGarvey
I have used the ggplot2 package to create a world map, the png file of the 
output is attached. The code I use is below:

library(ggplot2)
library(mapproj)
long_Min <- -180.0
long_Max <- 180.0
lat_Min <- -50.0
lat_Max <- 80.0
Width <- 12.0
Height <- 2.0*Width*(lat_Max-lat_Min)/(long_Max-long_Min)
windows(width = Width, height = Height,record = TRUE)
World_map_data <- map_data("world")
World_map_dataS <- subset(World_map_data, (long >= long_Min & long <= long_Max) 
& (lat >= lat_Min & lat <= lat_Max))
#Europe_data <- map_data("europe")
O_lat <- runif(10, min=lat_Min, max=lat_Max)
O_long <- runif(10, min=long_Min, max=long_Max)
D_lat <- runif(10, min=lat_Min, max=lat_Max)
D_long <- runif(10, min=long_Min, max=long_Max)
Routes = data.frame(O_lat,O_long, D_lat,D_long)
g1 <- ggplot(World_map_dataS, aes(x=long, y=lat, group=group, fill=region)) +
  geom_polygon(fill="white", colour="blue") +
  coord_map("mercator")
g1


I have a list of shipments with the lat/long of the Origin cities and 
destination cities in a dataframe Routes. A test example is shown below:

structure(list(O_lat = c(57.8440704662353, 43.4692783257924, 
34.197948181536, -13.9658199064434, 28.1358464458026, 54.8644948145375, 
54.7105941944756, 0.960986674763262, -9.04949014307931, 67.3708150233142
), O_long = c(-135.800734693184, -139.97953729704, 130.949327526614, 
120.016278969124, -81.3588178250939, 107.188451411203, -166.396527299657, 
6.01017326116562, 119.992827912793, 68.8450227119029), D_lat = 
c(13.1392757641152, 
-48.4003935428336, -18.0977397086099, 7.47306475648656, 38.8207479682751, 
-6.95962310535833, 21.4299688511528, 77.7941568545066, -39.2934810533188, 
-5.45942842029035), D_long = c(-161.594757176936, -8.55208304710686, 
59.6322040446103, 16.3289373647422, -82.6615255884826, -150.326664168388, 
-86.496180742979, -162.877350552008, -119.206758281216, -110.952316028997
)), class = "data.frame", row.names = c(NA, -10L))


this dataframe consists of 10 shipments. How do I add these shipments as 
individual lines onto the world map. If I need to I can convert from lat & long 
to map coordinates using the mercator projection equations. My issue is what 
ggplot commands to use.

Thanks

Bernard McGarvey


Director, Fort Myers Beach Lions Foundation, Inc.


Retired (Lilly Engineering Fellow).__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] plot shows exponential values incompatible with data

2020-07-09 Thread Bernard Comcast
Use the xlim option in the plot function?

Bernard
Sent from my iPhone so please excuse the spelling!"

> On Jul 9, 2020, at 10:06 AM, Luigi Marongiu  wrote:
> 
> Thank you,
> but why it does not work in linear? With the log scale, I know it
> works but I am not looking for it; is there a way to force a linear
> scale?
> Regards
> Luigi
> 
>> On Thu, Jul 9, 2020 at 3:44 PM Fox, John  wrote:
>> 
>> Dear Luigi,
>> 
>>>> On Jul 9, 2020, at 8:59 AM, Luigi Marongiu  
>>>> wrote:
>>> 
>>> Hello,
>>> I have these vectors:
>>> ```
>>> X <- 1:7
>>> Y <- c(1438443863, 3910100650, 10628760108, 28891979048, 78536576706,
>>> 213484643920, 580311678200)
>>> plot(Y~X)
>>> ```
>>> The y-axis starts at 0e0, but the first value is 1.4 billion. Why the
>>> axis does not start at 1e9?
>> 
>> Because you're plotting on a linear, not log, scale, and 0*10^11 = 0.
>> 
>>> round(Y/1e11)
>> [1] 0 0 0 0 1 2 6
>> 
>> Then try plot(log(Y) ~ X).
>> 
>> I hope this helps,
>> John
>> 
>>  -
>>  John Fox, Professor Emeritus
>>  McMaster University
>>  Hamilton, Ontario, Canada
>>  Web: http::/socserv.mcmaster.ca/jfox
>>> 
>>> 
>>> 
>>> --
>>> Best regards,
>>> Luigi
>>> 
>>> __
>>> R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
>>> https://stat.ethz.ch/mailman/listinfo/r-help
>>> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
>>> and provide commented, minimal, self-contained, reproducible code.
>> 
> 
> 
> -- 
> Best regards,
> Luigi
> 
> __
> R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] How to run Hutcheson t-test on R?

2020-09-07 Thread Bernard Comcast
This website has an example calculation shown in Excel Which might help in 
programming it in R.

https://www.dataanalytics.org.uk/comparing-diversity/


Bernard
Sent from my iPhone so please excuse the spelling!"

> On Sep 7, 2020, at 6:17 PM, Rolf Turner  wrote:
> 
> 
>> On Mon, 7 Sep 2020 11:17:36 +0200
>> Luigi Marongiu  wrote:
>> 
>> Hello,
>> is it possible to run the Hutcheson t-test
>> (https://www.sciencedirect.com/science/article/abs/pii/0022519370901244)
>> on R?
> 
> Almost surely.  With R, all things are possible. :-)
> 
>> How?
> 
> Program it up?
> 
> cheers,
> 
> Rolf Turner
> 
> -- 
> Honorary Research Fellow
> Department of Statistics
> University of Auckland
> Phone: +64-9-373-7599 ext. 88276
> 
> __
> R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.

[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[R] histograms embedded in a plot (as alternative to jitter)

2014-03-05 Thread Bernard North
Dear R list,

I am plotting a discrete valued number on the y axis against a continuous 
variable on the x axis.
To allow sample size to be viewed for the discrete groups I am using vertical 
jitter.
So my code is along the lines of
y<-rpois(500,2)
x<-rnorm(500,y,1)
plot(x,jitter(y))

It has not been suggested that a more informative view of the sample size might 
be if a histogram could be inserted into the plot (instead of the jittered rows 
of points) for the values at each y-value
Many thanks if anyone can think of a way to do this





This email may contain information that is privileged, confidential or 
otherwise protected from disclosure.
It must not be used by, or its contents copied or disclosed to, persons other 
than the addressee.
If you have received this email in error please notify the sender immediately 
and delete the email.
This message has been scanned for viruses.\ \ \ [[alter...{{dropped:6}}

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[R] Chess Playing Software Written in R

2013-10-28 Thread Rob Bernard
Have there been attempts to build a chess engine in R?  If so, is it
available anywhere?

I recognize that R really isn’t the right language for a chess engine, but
I was more curious if it had been attempted.

Thank you.

Rob Bernard

-- 
--
Robert N. Bernard
minus...@alumni.princeton.edu

[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[R] issue with Matrix package

2010-10-22 Thread Bernard SEBASTIEN
I have an issue with Matrix package.
When I try to load it (with R version 2.10.1 with Windows XP) I have an error 
message in return:

 Error in registerS3method(Info[i, 1], Info[i, 2], Info[i, 3], env) : 
  aucun slot de nom "methods" pour cet objet de la classe "derivedDefaultMethod"

any idea on how I could solve this issue ?

thanks




__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[R] graphing plots of plots

2010-08-21 Thread Bernard Leemon
I want to make a graph where each element plotted is itself a graph.  I can
see how to use par(fig=) and viewport to do that, but they require (i think)
me to do my own scaling as they are scaled to the graphics window.  any
advice on which approach I should take (just bite the bullet and do my own
scaling), or is there something else I should try, or any examples I should
look at.  many thanks for any pointers.

bernie leemon (aka gary mcclelland)

[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] graphing plots of plots

2010-08-21 Thread Bernard Leemon
many useful suggestions that I'll work on, especially babtiste's detailed
code. yes, I want something like Fig 1.7, or 7.18, or 7.22, but where the
x,y values are characteristics of the mini-histogram that is plotted.
 attached (if it makes it through) is what i'm trying to do in R.



On Sat, Aug 21, 2010 at 4:08 PM, Dennis Murphy  wrote:

> Once you load
>
> library(grid)
>
> the rest works. Nice job :)
>
> Dennis
>
> On Sat, Aug 21, 2010 at 1:15 PM, baptiste auguie <
> baptiste.aug...@googlemail.com> wrote:
>
> > Hi,
> >
> >
> > I think you could do it quite easily with lattice,
> >
> > library(lattice)
> >
> > latticeGrob <- function(p, ...){
> >   grob(p=p, ..., cl="lattice")
> > }
> > drawDetails.lattice <- function(x, recording=FALSE){
> >   lattice:::plot.trellis(x$p, newpage=FALSE)
> > }
> >
> > plots <- replicate(4, xyplot(rnorm(10)~rnorm(10),xlab="",ylab=""),
> > simplify=F)
> >
> > my.vp <- function(x,y)
> > viewport(x=x,y=y,default.units="native",width=unit(1, "cm"),
> > height=unit(1,"cm"))
> >
> > my.panel = function(x, y, ...){
> >  ind <- seq_along(x)
> >  for (ii in ind){
> >g <- latticeGrob(plots[[ii]], vp=my.vp(x[ii],y[ii]))
> >grid.draw(g)
> >  }
> > }
> >
> > xyplot(1:4~1:4, panel = my.panel)
> >
> > HTH,
> >
> > baptiste
> >
> > On 21 August 2010 22:11, Barry Rowlingson 
> > wrote:
> > > On Sat, Aug 21, 2010 at 8:48 PM, r.ookie  wrote:
> > >> I'm trying to understand your question because when I think of a
> graph,
> > I think of one canvas, on which, various functions are plotted (a
> function
> > can be one point for example).
> > >>
> > >> So, when you say each 'element' do you mean each function?
> > >> If so, then that seems to be asking how to plot a function per graph
> > (which is probably obvious and not what you're asking)
> > >>
> > >> How about you clarify first :)
> > >>
> > >
> > >  Sounded to me a bit like plotting pie charts at the locations of
> > > countries on a map. Or something better (not hard).
> > >
> > >  subplot from Hmisc?
> > >
> > >  library(Hmisc)
> > >  example(subplot)
> > >
> > > Barry
> > >
> > > __
> > > R-help@r-project.org mailing list
> > > https://stat.ethz.ch/mailman/listinfo/r-help
> > > PLEASE do read the posting guide
> > http://www.R-project.org/posting-guide.html
> > > and provide commented, minimal, self-contained, reproducible code.
> > >
> >
> > __
> > R-help@r-project.org mailing list
> > https://stat.ethz.ch/mailman/listinfo/r-help
> > PLEASE do read the posting guide
> > http://www.R-project.org/posting-guide.html
> > and provide commented, minimal, self-contained, reproducible code.
> >
>
> [[alternative HTML version deleted]]
>
> __
> R-help@r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide
> http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>

[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] graphing plots of plots

2010-08-21 Thread Bernard Leemon
I've now tried Babtiste's code and my reaction is WOW!  it shows me how to
do just what I need to do.  I know enough to follow all the code but it
would have taken me a LOOO time to generate it.  thank you Babtiste!

gary

On Sat, Aug 21, 2010 at 2:15 PM, baptiste auguie <
baptiste.aug...@googlemail.com> wrote:

> Hi,
>
>
> I think you could do it quite easily with lattice,
>
> library(lattice)
>
> latticeGrob <- function(p, ...){
>   grob(p=p, ..., cl="lattice")
> }
> drawDetails.lattice <- function(x, recording=FALSE){
>   lattice:::plot.trellis(x$p, newpage=FALSE)
> }
>
> plots <- replicate(4, xyplot(rnorm(10)~rnorm(10),xlab="",ylab=""),
> simplify=F)
>
> my.vp <- function(x,y)
> viewport(x=x,y=y,default.units="native",width=unit(1, "cm"),
> height=unit(1,"cm"))
>
> my.panel = function(x, y, ...){
>  ind <- seq_along(x)
>  for (ii in ind){
>g <- latticeGrob(plots[[ii]], vp=my.vp(x[ii],y[ii]))
>grid.draw(g)
>  }
> }
>
> xyplot(1:4~1:4, panel = my.panel)
>
> HTH,
>
> baptiste
>
> On 21 August 2010 22:11, Barry Rowlingson 
> wrote:
> > On Sat, Aug 21, 2010 at 8:48 PM, r.ookie  wrote:
> >> I'm trying to understand your question because when I think of a graph,
> I think of one canvas, on which, various functions are plotted (a function
> can be one point for example).
> >>
> >> So, when you say each 'element' do you mean each function?
> >> If so, then that seems to be asking how to plot a function per graph
> (which is probably obvious and not what you're asking)
> >>
> >> How about you clarify first :)
> >>
> >
> >  Sounded to me a bit like plotting pie charts at the locations of
> > countries on a map. Or something better (not hard).
> >
> >  subplot from Hmisc?
> >
> >  library(Hmisc)
> >  example(subplot)
> >
> > Barry
> >
> > __
> > R-help@r-project.org mailing list
> > https://stat.ethz.ch/mailman/listinfo/r-help
> > PLEASE do read the posting guide
> http://www.R-project.org/posting-guide.html
> > and provide commented, minimal, self-contained, reproducible code.
> >
>
> __
> R-help@r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide
> http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>

[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[R] nls() newbie convergence question

2008-06-04 Thread Bernard Leemon
I'm sure this must be a nls() newbie question, but I'm stumped.
I'm trying to do the example from Draper
and Yang (1997).  They give this snippet of S-Plus code:

Specify the weight function:
weight < - function(y,x1,x2,b0,b1,b2)
{
pred <-  b0+b1*x1 + b2*x2
parms <- abs(b1*b2)^(1/3)
(y-pred)/parms
}
Fit the model
gmfit < -nls(~weight(y,x1,x2,b0,b1,b2), observe,list("starting value"))

in converting this to R, I left the weight function alone and replaced the
nls() with

gmfit <-
 
nls(~weight(y,x1,x2,b0,b1,b2),data=dydata,trace=TRUE,start=list(b0=1,b1=1,b2=1))

where dydata is the appropriate data.frame.

nls() quickly (6 iterations) finds the exact values from Draper & Yang for
b0, b1, and b2 but
despite reporting a discrepancy of only 3.760596e-29 by the 7th iteration,
it merrily goes on
to 50 iterations and thinks it never converged.  how do I tell nls() that
I'm actually quite
happy with 3.760596e-29 and it need not work further?

I've attached the full file if you want to play with it.

thanks,
  gary mcclelland (aka bernie)
__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[R] nls() newbie convergence problem

2008-06-04 Thread Bernard Leemon
I'm sure this must be a nls() newbie question, but I'm stumped.
I'm trying to do the example from Draper
and Yang (1997).  They give this snippet of S-Plus code:

Specify the weight function:
weight < - function(y,x1,x2,b0,b1,b2)
{
pred <-  b0+b1*x1 + b2*x2
parms <- abs(b1*b2)^(1/3)
(y-pred)/parms
}
Fit the model
gmfit < -nls(~weight(y,x1,x2,b0,b1,b2), observe,list("starting value"))

in converting this to R, I left the weight function alone and replaced the
nls() with

gmfit <-
 
nls(~weight(y,x1,x2,b0,b1,b2),data=dydata,trace=TRUE,start=list(b0=1,b1=1,b2=1))

where dydata is the appropriate data.frame.

nls() quickly (6 iterations) finds the exact values from Draper & Yang for
b0, b1, and b2 but
despite reporting a discrepancy of only 3.760596e-29 by the 7th iteration,
it merrily goes on
to 50 iterations and thinks it never converged.  how do I tell nls() that
I'm actually quite
happy with 3.760596e-29 and it need not work further?

thanks for any suggestions.

gary mcclelland (aka bernie)
univ of colorado

[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[R] Random effects dimension in nlme and P-values

2008-06-10 Thread Marc Bernard
Dear All,
   
  I don't know whether this question is appropriate for this list or not. My 
question is as follows:
   
  I am fitting a non-linear mixed model  using the SSlogis  function.  When the 
parameters  xmid and scal are both considered as random (let us say model M1), 
the p-value for my covariate of interest is greater than 0.05 
(non-significant). However, when only the xmid is considered as random (Model 
M2), the p-value is less than 0.05 and my covariate becomes highly significant. 
The introduction of random effects of course increases the variability in the 
fixed effects but does not affect their Bias as I understand. My question is: 
Is it then legitimate to use the model with only xmid as random effects (model 
M2 since it gives me significant results)? knowing that the AIC for M1 is lower 
than that one for M2 meaning that M1 is slightly fitting better  the data than 
M2
   
  Many thanks in advance
   
  Bernard,
   


   
-

Une boite mail plus intelligente. 
[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[R] NLME: Prediction intervals for random effects

2008-06-16 Thread Marc Bernard
Dear all, 
 
Is there a function to calculate the  prediction intervals for random 
effects in non-linear mixed models? I found a way to do it for linear mixed 
models but not for non-linear mixed one.
 
Many thnaks
 
Bernard
 
 


  
_ 

o.fr
[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[R] prediction intervals for random effects in nlme

2008-06-16 Thread Marc Bernard
Dear all, 
 
This is a relist of my previous question. I noticed that some 
characters were  not displayed in the previous version.
 
 
Is there a function to calculate the  prediction intervals for random 
effects in non-linear mixed models? I found a way to do it for linear mixed 
models but not for non-linear mixed one.
 
Many thanks
 
Bernard


  
_ 

o.fr
[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[R] sequence of vectors

2007-11-19 Thread Marc Bernard
Dear All,
   
  I wonder if there is any R function to generate a sequence of vectors from 
existing ones. For example:
  x 1<- c(1,2,3)
  x2 <- c(4,5)
  x3 <- c(6,7,8)
   
  The desired output is a list of all 3*2*3 = 18 possible combinations of 
elements of x1,x2 and x3. One element for example is (1,4,6).
   
  Many thanks in advance,
   
  Bernard
   
   

 
-

[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[R] Choosing the right model

2007-11-21 Thread Marc Bernard
Dear All,
  Sorry if this question may not be appropriate to this list. I have the 
following question about the significance of effects in NLME. I fitted data 
with nlme using  the SSlogis as a  specification for the conditional mean of my 
dependent variable Y. When xmid and scal were considered as random,  my 
covarite of interest X was found to have a significant effect on xmid but not 
on scal. However, when I assume that only xmid is random, the effect of my 
covariate X was found to have a significant effect on both xmid and scal. Of 
course the AIC and the residuals were both smaller in the firts model. Thus my 
question: Which model should I select: the one that  fits  better to the data 
(i.e Model 1) or the one that shows significant effects of my covariate 
(Model2). Or in another way, Is it legitimate to use model 2?
   
  Many thanks in advance,
   
  Bernard
   
   

 
-

[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[R] bootstrap for nlme

2007-11-23 Thread Marc Bernard
Dear All,
   
  Is there any bootstrap function in nlme for a non linear mixed model. Either 
a non-parametric or parametric one. 
   
  Thanks
  Bernard
   

 
-

[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[R] lme output

2007-12-05 Thread Marc Bernard
Dear all,
   
  I noticed the following in the call of lme using msVerbose.
   
  fm1 <- lme(distance ~ age, data = Orthodont, control = 
lmeControl(msVerbose=T))
   
9  318.073: -0.567886 0.152479  1.98021
 10  318.073: -0.567191 0.152472  1.98009
 11  318.073: -0.567208 0.152473  1.98010

   
  fm2 <- lme(distance ~ age, random =~age, data = Orthodont, 
lmeControl(msVerbose=T))
   
7  318.073: -0.342484  1.75530  4.44650
  8  318.073: -0.342507  1.75539  4.44614
  9  318.073: -0.342497  1.75539  4.44614

   
  The two model are equivalent and give the same estimates. However, the 
optimal parameters in the profiled log-likelihood are not the same? why?
   
  As I usually thought, the parameters optimised in the profiled likelihood are 
the log of the precision matrix. The latter can be  derived  as a Cholesky 
factorization of  the product between the residuals variance and the inverse of 
the random effects covariance. When I check that it's not the case for model 
fm1 even if it's equivalent to model fm2.
   
   log(chol(((summary(fm1)$sigma)^2)*solve( matrix(getVarCov(fm1), nrow=2
   
 [,1][,2]
[1,] -0.3424971 1.492037
[2,]  -Inf   1.755388

  log(chol(((summary(fm2)$sigma)^2)*solve( matrix(getVarCov(fm2), nrow=2

   
 [,1][,2]
[1,] -0.3424971 1.492037
[2,]  -Inf   1.755388

   
  In the two mdels, this terms are equals to the optimized parameters in fm2 
not in fm1. I am missing something I suppose.
   
  Bests,
   
  Bernard

 
-

[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[R] confidence interval for roc curves

2009-02-05 Thread marc bernard

Dear all,
 
I am looking for an R package that allows me to calculate and plot the 
confidence limits for the roc curve using for example some bootstrapping.
 I tried "ROCR" who seems doing such work but i couldn't find the right option 
to do it.
 
Many thanks
 
Bests
 
Marc
 
_


tarted! 

[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[R] Roc curves confidence intervals

2009-02-05 Thread marc bernard

Dear all, I am looking for an R package that allows me to calculate and plot 
the confidence intervals for the roc curve using for example some 
bootstrapping. I tried "ROCR" who seems doing such work but i couldn't find the 
right option in it. Many thanks Bests Marc
_


[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[R] boxplot and number of observations per box

2008-01-30 Thread Marc Bernard
Dear all,
   
  How can I plot the number of observations per box in a boxplot. Many thanks,
   
  Bernard
   
   

   
-

[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[R] boxplot and number of observations per box

2008-01-30 Thread Marc Bernard
Dear all,
   
  How can I plot the number of observations per box in a boxplot. Many thanks,
   
  Bernard
   
   

   
-

[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] how to calculate chisq value in R

2008-02-07 Thread Bernard Leemon
On Thu, Feb 7, 2008 at 1:06 PM, John Kane <[EMAIL PROTECTED]> wrote:

> ?chisq.test
> --- jinjin <[EMAIL PROTECTED]> wrote:
>
> >
> > for example, an expression such as chisq(df=1,ncp=0)
> > ?
> >


perhaps pchisq(chisqvalue, df=1, ncp=0) is what you are looking for to
evaluate the probability for a given chi-squre value from its distribution
function.

or if by chisq.test you mean how to compute a contingency table chi-sq
value, see

http://psych.colorado.edu/~mcclella/psych3101h/StatFinder/twoWayChiSquare.html

gary mcclelland
Colorado

[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[R] a kinder view of Type III SS

2008-02-07 Thread Bernard Leemon
A young colleague (Matthew Keller) who is an ardent fan of R is teaching me
much about R and discussions surrounding its use.  He recently showed me
some of the sometimes heated discussions about Type I and Type III errors
that have taken place over the years on this listserve.  I'm presumptive
enough to believe I might add a little clarity.  I write this from the
perspective of someone old enough to have been grateful that the stat
programmers (sometimes me coding in Fortran) thought to provide me with
model tests I had not asked for when I carried heavy boxes of punched cards
across campus to the card reader window only to be told to come back a day
or two later for my output.  I'm also modern enough to know that
anova(model1, model2), where model2 is a proper subset of model1, is all
that I need and allows me to ask any question of my data that I want to ask
rather than being constrained to those questions that the SAS or SPSS
programmer thought I might want to ask.  I could end there, and we would
probably all agree with what I have said to this point, but I want to push
the issue a bit and say: it seems that Type III Sums of Squares are being
unfairly maligned among the R cognoscenti. And the practical ramification of
this is that it creates a good deal of confusion among those migrating from
SAS/SPSS land into R - not that this should ever be a reason to introduce a
flawed technique into R, but my argument is that type III sums of squares
are not a flawed technique.

In my reading of the prior discussions on this list, my conclusion is that
the Type I/Type III issue is a red herring that has generated unnecessary
heat.  Base R readily provides both types.  summary(lm( y ~ x + w + z))
provides estimates and tests consistent with Type III sums of squares (it
doesn't provide the SS directly but they are easily derived from the output)
and anova(lm(y ~ x + w + z)) provides tests consistent with Type I sums of
squares.  The names Type I and III are dreadful "gifts" from SAS and others.
 I'd prefer "conditional tests" for those provided by summary() because what
is estimated and tested are x|w,zw|x,z   and  z|x,w [read these as "x
conditional on w and z being in the model"] and "sequential" for those
provided by anova(), being x, w|x, and z|x,w.  None of these tests is more
or less valid or useful than any of the others.  It depends on which
questions researchers want to ask of their data.

Things get more interesting when z  represents the interaction between x and
w, such that z = x * w = xw.  Fundamentally everything is the same in terms
of the above tests.  However, one must be careful to understand what the
coefficient and test for x|w,xw and w|x,xw mean.  That is, x|w,xw tests the
relationship between x and y when and only when w = 0.  A very, very common
mistake, due to an overgeneralization of traditional anova models, is to
refer to x|w,xw as the "main effect."  In my list of ten statistical
commandments I include: "Thou shalt never utter the phrase main effect"
 because it causes so much unnecessary confusion.  In this case, x|w,xw is
the SIMPLE effect of x when w = 0.  This means among other things that if
instead we use w' = w - k so as to change the 0 point on the w' scale, we
will get a different estimate and test for x|w',xw'. Many correctly argue
that the main effect is largely meaningless in the presence of an
interaction because it implies there is no common average effect.  However,
that does not invalidate x|w,xw because it is NOT a "main" (sense
"principal" or "chief") effect but only a "simple" effect for a particular
level of w.  A useful strategy for testing a variety of simple effects is to
subtract different constants k from w so as to change the 0 value to focus
the test on particular simple effects.


 If x and w are both contrast codes (-1 or 1) for the two factors of a 2 x 2
design, then x|w,xw is the simple effect of x when w = 0.   While w never
equals 0, in a balanced design w does equal 0 on average.  In that one very
special case, the simple effect of x when w = 0 equals the average of all
the simple effects and in that one special case one might call it the "main
effect."  However, in all other situations it is only the simple effect when
w = 0.  If we discard the term "main effect", then a lot of unnecessary
confusion goes away.  Again, if one is interested in the simple effect of x
for a particular level of w, then one might want to use, instead of a
contrast code, a dummy code where the value of 0 is assigned to the level of
w of interest and 1 to the other level.

When factors have multiple levels, it is best to have orthogonal contrast
codes to provide 1-df tests of questions of interest.  Products of those
codes are easily interpreted as the simple difference for one contrast when
the other contrast is fixed at some level.  Multiple degree of freedom
omnibus tests are troublesome but are only of interest if we are fixated on
concepts like 'main effect.'

gary m

Re: [R] correlation

2008-02-08 Thread Bernard Leemon
It is easy to worry too much about using numbers to represent order when
using statistics like the correlation.  this little example shows that the
correlation is essentially a rank-order correlation itself:
> x <- 1:20
> y <- x^2
> cor(x,y)
[1] 0.9713482

x and y are definitely not linearly related, yet the correlation is
extremely high.  As Peter suggests, you could be 'safe' using a Spearman
correlation, which is identical to cor(rank(x), rank(y)).  But the rank
transform may be more destructive to your data than need be.


gary mcclelland
colorado

On Fri, Feb 8, 2008 at 9:14 AM, <[EMAIL PROTECTED]> wrote:

> Dear list
>
> I would like to compare two measurements of disease severity (M1 and
> M2), one of the is continuous (M1 ranging from 1 to 10) and the other
> is ordinal (M2 takes Low, Medium, high and very high). Do you think is
> ok to use cor() function to test whether the two agree, i.e correlate?
> I am afraid that if I set M2 to 1,2,3 and 4, the function cor() will
> take them as continuous and therefore lose intrepretation.
>
> Thanks for your commments
>
> David
>
> __
> R-help@r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide
> http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>

[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] R on Mac PRO does anyone have experience with R on such a platform ?

2008-02-09 Thread Bernard Leemon
I have R on all sorts of Macs, including one's a lot whimpier than the one
you are describing and it works great on all of them.
gary mcclelland
colorado

On Sat, Feb 9, 2008 at 6:29 PM, Maura E Monville <[EMAIL PROTECTED]>
wrote:

> I saw there exists an R version for Mac/OS.
> I'd like to hear from someone who is running R on a Mac/OS before
> venturing
> on getting  the following  computer system.
> I am in the process of choosing a powerful laptop 17" MB PRO
> 2.6GHZ(dual-core)  4GBRAM 
>
> Thank you so much,
> --
> Maura E.M
>
>[[alternative HTML version deleted]]
>
> __
> R-help@r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide
> http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>

[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] Do I need to use dropterm()??

2008-02-10 Thread Bernard Leemon
Hi Dani,
it would be better to start with a question you are trying to ask of your
data rather than trying to figure out what a particular function does.  with
your variables and model, even if the component terms were not significant,
they must in the model or the product of sunlight and aspect will NOT
represent the interaction.  also note that the tests of your components are
probably not what you think they are.  in general, tests of components of
interactions test the simple effect of that variable when the other variable
is 0.  hence, your 'significant' result for aspect pertains to when log
sunlight is 0, which probably isn't what you want to be testing.  what the
significant effect for sunlight means depends on how aspect was coded.  you
should check to see what code was used to know what zero means.

gary mcclelland
colorado

On Sun, Feb 10, 2008 at 6:40 AM, DaniWells <[EMAIL PROTECTED]>
wrote:

>
> Hello,
>
> I'm having some difficulty understanding the useage of the "dropterm()"
> function in the MASS library. What exactly does it do? I'm very new to R,
> so
> any pointers would be very helpful. I've read many definitions of what
> dropterm() does, but none seem to stick in my mind or click with me.
>
> I've coded everything fine for an interaction that runs as follows: two
> sets
> of data (one for North aspect, one for Southern Aspect) and have a
> logscale
> on the x axis, with survival on the y. After calculating my anova results
> i
> have all significant results (ie aspect = sig, logscale of sunlight = sig,
> and aspect:llight = sig).
>
> When i have all significant results in my ANOVA table, do i need
> dropterm(),
> or is that just to remove insignificant terms?
>
> Many thanks,
>
> Dani
> --
> View this message in context:
> http://www.nabble.com/Do-I-need-to-use-dropterm%28%29---tp15396151p15396151.html
> Sent from the R help mailing list archive at Nabble.com.
>
> __
> R-help@r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide
> http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>

[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] Using R in a university course: dealing with proposal comments

2008-02-11 Thread Bernard Leemon
Hi Arin,
Others have commented wisely an your first issue.  As for your 2nd issue, I
had my own concerns about using R in undergraduate teaching because I had
always used a point-and-click program for that level.  I should not have
worried.  The current generation has been typing on their keyboards and
their phones for a long time; they are very skilled.  They LIKE a
command-line interface, so long as someone gives them an initial cheat sheet
to get them going.  They like the price, they like having it on their own
computers, and they like that they can use it other courses.  Some students
are sometimes upset that no one has ever told them about R before.  Two
hours after the first lab in which I had students download R to their
laptops, I received an email from a student telling me about how she had
used R to do her physics homework.  I like the (almost)
platform-independence of R.  I've resisted using Rcmdr and JGR because I
want students to be able to use base R well.  If they want to customize
later, then fine.  But what I teach them will apply wherever they next
encounter R, whereas if were to use a lot of packages--especially one I
would be tempted to create to match my teaching more closely--then they
wouldn't be sure what to expect later.

gary mcclelland
Colorado

[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] R programming style

2008-02-11 Thread Bernard Leemon
I just got a copy of
A First Course in Statistical Programming with R by W. John Braun and Duncan
J. Murdoch.  Cambridge.  at amazon:
 http://www.amazon.com/First-Course-Statistical-Programming-R/dp/0521694248/

first couple of chapters are base R that most everyone would know before
wanting to program but then the other chapters on programming itself seem
pretty good so far.

gary mcclelland
colorado

On Mon, Feb 11, 2008 at 3:47 AM, David Scott <[EMAIL PROTECTED]> wrote:

>
> I am aware of one (unofficial) guide to style for R programming:
> http://www1.maths.lth.se/help/R/RCC/
> from Henrik Bengtsson.
>
> Can anyone provide further pointers to good style?
>
> Views on Bengtsson's ideas would interest me as well.
>
> David Scott
>
>
>
> _
> David Scott Department of Statistics, Tamaki Campus
>The University of Auckland, PB 92019
>Auckland 1142,NEW ZEALAND
> Phone: +64 9 373 7599 ext 86830 Fax: +64 9 373 7000
> Email:  [EMAIL PROTECTED]
>
> Graduate Officer, Department of Statistics
> Director of Consulting, Department of Statistics
>
> __
> R-help@r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide
> http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>

[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[R] good references on "survival analysis"

2008-02-19 Thread Marc Bernard
Dear all,
   
  I am looking for a good reference on "Survival analysis". I am looking for a 
booking containing both applications and Maths. Explaining different methods in 
survival analysis 
   
  Many thanks
   
   
  Bernard
   
   

   
-

[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[R] Help with cochran.test

2007-11-05 Thread Stephanie Bernard
Hi,
I have been trying to use the function cochran.test from the Outliers 
package to test for homogeneity of variance. This works well except when 
I use transformed data. Would anyone have an idea why it doesn't work 
and how I could do the cochran test on transformed data?
Thanks,
Stephanie

 >library(outliers)
 > set.seed(1234)
 > x=rnorm(100)
 > d=data.frame(x=x,group=rep(1:10,10))
 > cochran.test(x~group,d)

Cochran test for outlying variance

data:  x ~ group
C = 0.1619, df = 10, k = 10, p-value = 0.935
alternative hypothesis: Group 10 has outlying variance
sample estimates:
1 2 3 4 5 6 
7 8 910
0.9702567 1.0762180 0.9489474 0.9098832 1.1665495 0.9753678 1.2960769 
0.8036918 0.7193931 1.7127172

 > cochran.test(log(x)~group,d)
Error in tapply(data[[bn[1]]], by.factor, var) :
arguments must have same length

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[R] Help with Bartlett's test on linear model

2007-11-14 Thread Stephanie Bernard

Hi all,
I would like to test the homoegeneity of variances between several 
linear model for some analysis of covariance. It seems that the 
Bartlett's test is a good test to use but I am having problem using with 
linear model and I cannot find any examples on the internet. There are 
some examples for comparisons of variances but not linear models.
If I take the hellung data set, which is the example in Dalgaard's book. 
I know var.test works fine but I want to learn how to use the Bartlett's 
test.

> hellung$glucose <- factor(hellung$glucose, labels=c("Yes","No"))
> attach(hellung)
> tethym.gluc <- hellung[glucose=="Yes",]
> tethym.nogluc <- hellung[glucose=="No",]
> lm.nogluc <- lm(log10(diameter)~log10(conc), data=tethym.nogluc)
> lm.gluc <- lm(log10(diameter)~log10(conc), data=tethym.gluc)
I guess I have two questions. 1) How to use bartlett.test with linear 
model (using the model above) and 2) how to test for homogeneity of 
variances of linear models when there are more than two groups.

Thanks,
Stephanie




__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] Nagelkerkes R2N

2009-07-15 Thread North, Bernard V


I am interested Andrea is whether you ever established why your R2 was 1.
I have had a similar situation previously.

My main issue though, which I'd be v grateful for advice on, is why I am 
obtaining such  negative values -0.3  for Somers Dxy  using validate.cph from 
the Design package given my value of Nagelkerke R2 is not so low 13.2%.

I have this output when fitting 6 variables all with p-values<0.01
I am wondering what the interpretation should be.
I know my Nagelkerke R2 isn't very good but I compare my results with the 
example from ?validate.cph and although I have a better R2 (13% v 9%) the 
Somers dxy from the example data set is much better, 38%, so certainly not 
negative !

 So my main question is : Why such a difference between explained variation, 
R2, and predictive ability: somers dxy ??

Obs Events Model L.R.   d.f.  P  ScoreScore P R2
   471228  66.36  6  0  73.41  0
  0.132



>  validate(f, B=150,dxy=T)   # normally B=150

 index.orig  training test optimism index.corrected   n
Dxy   -0.3022537331 -0.3135032097 -0.292492573 -0.021010636   -0.2812430968 150
R2 0.1319445685  0.1431179294  0.122599605  0.0205183240.1114262446 150
Slope  1.00  1.00  0.923340558  0.0766594420.9233405576 150
D  0.0250864459  0.0276820092  0.023163167  0.0045188420.0205676038 150
U -0.0007676033 -0.0007725071  0.000610456 -0.0013829630.0006153598 150
Q  0.0258540493  0.0284545164  0.022552711  0.0059018050.0199522440 150


I also calculated the Schemper and Henderson V measure and obtained v=10.5%

I was  using the surev package of Lusa Lara; Miceli Rosalba; Mariani 
LuigiEstimation of predictive accuracy in survival analysis using R and 
S-PLUS.
Computer methods and programs in biomedicine 2007;87(2):132-7.
And my code was
library(surev)
pred.accuracy<-f.surev(f)
pred.accuracy

sorry if my question isn't clear - should I have included my sessionInfo for a 
methodological question ? (I'm a newbie)
many thanks for any advice

[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[R] negative Somers D from Design package

2009-07-15 Thread North, Bernard V
Dear R help

My problem is very similar to the analysis detailed here.
If we use the mayo dataset provided with the survivalROC package the estimate 
for Somer's Dxy is very negative -0.56.
The Nagelkerke R2 is positive though 0.32.
I know there is a difference between explained variation and predictive ability 
but I am surprised there is usch a difference given that even a non predictive 
model should have Dxy around 0.
Am I doing something wrong or is there an interpretation that makes sense ?

This is with the mayo data so its reproducible but the result with my data is 
very similar.
Many thanks in advance

library(survivalROC)
library(Design)
library(survival)
data(mayo)

 Sm <- Surv(mayo$time,mayo$censor)
fm <- cph( Sm ~ mayoscore4,mayo,x=T,y=T,surv=T )
validate(fm, B=150,dxy=T)
Iteration 1 

index.orig training test  optimism index.corrected   n
Dxy   -0.566027923 -0.55407 -0.566027923 -0.0006374833-0.565390440 150
R2 0.325860603  0.327350885  0.325860603  0.0014902826 0.324370320 150
Slope  1.0  1.0  0.987854765  0.0121452354 0.987854765 150
D  0.093398440  0.095166239  0.093398440  0.0017677983 0.091630642 150
U -0.001562582 -0.001579618  0.001150175 -0.0027297932 0.001167211 150
Q  0.094961022  0.096745857  0.092248266  0.0044975915 0.090463431 150



Dr Bernard North
Statistical Consultant
Statistical Advisory Service
Advice and Courses on Research Design and Methodology
Imperial College
South Kensington Campus
Room 845, 4th Floor
8 Princes Gardens
London SW7 1NA.

Tel: 020 7594 2034
Fax: 020 7594 1489
Email: bno...@imperial.ac.uk
Web:  www.ic.ac.uk/stathelp




[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[R] using axis.Date with interaction.plot

2009-10-13 Thread North, Bernard V
Dear List

I want to plot multiple time series (several outcomes) with dates at intervals 
on the x axis and a legend.

Is it possible to use axis.Date to get dates, at intervals in  my case, on the 
x axis of a (multiple) time series plot.
The axis.Date in the code below doesn't produce any dates on the x axis. (The 
difference outcome measures are all variable outcome in dataframe speclong and 
the  different groups correspond to different values of the variable time with 
values 1 to 8)

But the same axis.Date command gives x axis Dates perfectly if following an 
ordinary plot command. So I suppose I could do that and add time series for 
successive time series using lines( but then I wouldn't have a legend or I'd 
have to create one "manually"

Many thanks for any advice

Bernard

speclong
  Date time outcome id
1.1 1998-01-291 8.11879e-13  1
2.1 1998-02-171 9.11297e-13  2
3.1 1998-03-201 4.95558e-13  3
4.1 1998-05-071 4.34171e-13  4
5.1 1998-05-261 2.41658e-13  5
6.1 1998-06-051 4.89529e-13  6

82.8 2005-07-158 2.37023e-11 82
83.8 2005-08-238 3.52766e-11 83
84.8 2005-09-088 1.98099e-11 84
85.8 2005-10-188 2.93576e-11 85
86.8 2005-11-188 6.30531e-11 86
87.8 2005-12-018 5.71245e-11 87
> interaction.plot(speclong$Date,speclong$time,speclong$outcome,log="y",xaxt="n",col=rainbow(8)
>  )
> axis.Date(1,at=(as.Date("1998-01-01") +c(0:7)*365.25),format="%d/%m/%y", 
> las=2)
>
> sessionInfo()
R version 2.9.0 (2009-04-17)
i386-pc-mingw32

locale:
LC_COLLATE=English_United Kingdom.1252;LC_CTYPE=English_United 
Kingdom.1252;LC_MONETARY=English_United 
Kingdom.1252;LC_NUMERIC=C;LC_TIME=English_United Kingdom.1252

attached base packages:
[1] stats graphics  grDevices utils datasets  methods   base

[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[R] output (p-values) of "fastbw" in Design package

2009-10-27 Thread North, Bernard V
I am using the validate option in the Design package with the Cox survival 
model.
I am using the bw=T option which, like the fastbw function, performs a backward 
elimination variable selection
The output includes a series of columns (below) giving information on 
eliminated variables.
My question is that I am unsure of the difference between the 2 p-values given 
(the one after Chi-Sq and the one after df)
This may be a gap in my statistics knowledge, hopefully I've not asked too 
silly a question, many thanks in advance

Backwards Step-down - Original Model

 DeletedChi-Sq d.f. P  Residual d.f. P  AIC

[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[R] confidence intervals for Harrell's c-index in survival setting

2010-08-17 Thread North, Bernard V
Dear All,

Is it possible to get confidence intervals for Harrell's concordance index or, 
equivalently, Somer's D using the rms package or in some other way ?
I have survival data it would be the c-index in the Cox model setting

Many thanks




Dr Bernard North
Statistical Consultant
Statistical Advisory Service
Advice and Courses on Research Design and Methodology
Imperial College South Kensington Campus
8 Princes Gardens Room 845, 4th Floor

London SW7 1NA.

Tel: 020 7594 2034
Fax: 020 7594 1489
Email: bno...@imperial.ac.uk<mailto:bno...@imperial.ac.uk>
Web:  www.ic.ac.uk/stathelp<http://www.ic.ac.uk/stathelp>


[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[R] C-statistics (AUCs) from rcorr.cens or survcomp time-dependent ROC curves

2011-03-25 Thread North, Bernard V
I am using the rcorr.cens function from the Hmisc package and the 
time-dependent ROC curve obtained using tdrocc in the survcomp package.

I understand that the C statistic from rcorr.cens has to be subtracted from 1 
if high values of the risk variable lower survival.
Given that I wonder what the connection is between that C statistic and the AUC 
from the tdrocc object. Are they expected to be the same ?
Many thanks in advance


[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[R] relation between tdrocc AUC and c-statistic from rcorr.cens

2011-06-21 Thread North, Bernard V
I am using the rcorr.cens function from the Hmisc package and the 
time-dependent ROC curve obtained using tdrocc in the survcomp package.

I understand that the C statistic from rcorr.cens has to be subtracted from 1 
if high values of the risk variable lower survival.
Given that I wonder what the connection is between that C statistic and the AUC 
from the tdrocc object.  If they are substantially different are there any 
views on which one is to be preferred ?

Many thanks in advance

[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[R] Simulated annealing method with restarts

2008-05-09 Thread Gordon, Bernard (Research)
Hello R-Help,
   I'm using R to do some optimization, specifically using the optim
method with method = 'SANN' (simulated annealing).  I read the help
file, and noticed that this method does not include restarts/reheats,
which I think would help my optimization significantly.  Does anyone
know of an implementation that does this?  I searched both the internet
and the help archives and was unable to find anything.  Thanks in
advance.
 
Bernard Gordon


This is not an offer (or solicitation of an offer) to buy/sell the 
securities/instruments mentioned. Morgan Stanley may deal as principal in or 
own or act as market maker to securities/instruments mentioned or may advise 
the issuers. This may refer to a research analyst/research report. For 
additional information, research reports and important disclosures, contact me 
or see https://secure.ms.com. We do not represent this is accurate or complete 
and we may not update this. Past performance is not indicative of future 
returns. This communication is solely for the addressee(s) and may contain 
confidential information. We do not waive confidentiality by mistransmission. 
Contact me if you do not wish to receive these communications. This 
communication is directed in the UK to those persons who are professional and 
eligible counterparties (as defined in the UK Financial Services Authority's 
rules).

[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.