Re: [R] Exhaustive CHAID package

2015-04-22 Thread Michael Grant
Many thanks for your response, sir.

Here are two of the references to which I referred.  I've also personally 
explored several data sets in which the outcomes are 'known' and have seen high 
variability in the topology of the trees being produced but, typically 
Exhaustive CHAID predictions match the 'known' results better than any of the 
others, using default settings.

http://www.hindawi.com/journals/jam/2014/929768/
http://interstat.statjournals.net/YEAR/2010/articles/1007001.pdf

By inference, many research papers are choosing Exhaustive CHAID.

My concern is not that these procedures produce mildly variant trees but 
dramatically variant, with not even the same set of variables included.

Is CHAID available for use as an R package?  I thought R-FORGE was solely for 
developers?

Again, many thanks.

MCG

-Original Message-
From: Achim Zeileis [mailto:achim.zeil...@uibk.ac.at] 
Sent: Wednesday, April 22, 2015 3:30 AM
To: Michael Grant
Cc: r-help@R-project.org
Subject: Re: [R] Exhaustive CHAID package

On Tue, 21 Apr 2015, Michael Grant wrote:

 Dear R-Help:

 From multiple sources comparing methods of tree classification and 
 tree regressions on various data sets, it seems that Exhaustive CHAID 
 (distinct from CHAID), most commonly generates the most useful tree 
 results and, in particular, is more effective than ctree or rpart 
 which are implemented in R.

I searched a bit on the web for exhaustive CHAID and didn't find any 
convincing evidence that this method is most commonly the most useful. 
I doubt that such evidence exists because the methods are applicable to so many 
different situations that uniformly better results are essentially never 
obtained. Nevertheless, if you have references of comparison studies, I would 
still be interested. Possibly these provide insight in which situations 
exhaustive CHAID performs particularly well.

 I see that CHAID, but not Exhaustive CHAID, is in the R-forge, and I 
 write to ask if there are plans to create a package which employs the 
 Exhaustive CHAID strategy.

I wouldn't know of any such plans. But if you want to adapt/extend the code 
from the CHAID package, this is freely available.

 Right now the best source I can find is in SPSS-IBM and I feel a bit 
 disloyal to R using it.

I wouldn't be concerned about disloyalty. If you feel that exhaustive CHAID is 
the most appropriate tool for your problem and you have access to it in SPSS, 
why not use it? Possibly you can also export it from SPSS and import it into R 
using PMML. The partykit package has an example with an imported QUEST tree 
from SPSS.

 Michael Grant
 Professor
 University of Colorado Boulder

   [[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] Exhaustive CHAID package

2015-04-21 Thread Michael Grant
Dear R-Help:

From multiple sources comparing methods of tree classification and tree 
regressions on various data sets, it seems that Exhaustive CHAID (distinct 
from CHAID), most commonly generates the most useful tree results and, in 
particular, is more effective than ctree or rpart which are implemented in R.  
I see that CHAID, but not Exhaustive CHAID, is in the R-forge, and I write to 
ask if there are plans to create a package which employs the Exhaustive CHAID 
strategy.  Right now the best source I can find is in SPSS-IBM and I feel a 
bit disloyal to R using it.

Michael Grant
Professor
University of Colorado Boulder

[[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] lmer, p-values and all that

2013-03-27 Thread Michael Grant

Dear Help:

I am trying to follow Professor Bates' recommendation, quoted by Professor 
Crawley in The R Book, p629, to determine whether I should model data using the 
'plain old' lm function or the mixed model function lmer by using the syntax 
anova(lmModel,lmerModel).  Apparently I've not understood the recommendation or 
the proper likelihood ratio test in question (or both) for I get this error 
message: Error: $ operator not defined for this S4 class.

Would someone be kind enough to point out my blunder?

Thank you,
Michael Grant


[[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] Newly installed version; can't run lm function

2012-10-19 Thread Michael Grant
New installation seems to have behavior I cannot figure out.  Here is 
illustrative sequence where I load a small data set (test) from Crawley's files 
and try to run a simple linear model and get an error message.  Oddly, R 
reports that the variable 'test$ozone' is numeric while, after attaching test, 
the variable ozone is not numeric.  Can someone please help?  This behavior is 
occurring with multiple data sets loaded from outside R.  Thank you in advance.
Michael Grant


Example:
 test
   ozone garden
1  3  A
2  5  B
3  4  A
4  5  B
5  4  A
6  6  B
7  3  A
8  7  B
9  2  A
10 4  B
11 3  A
12 4  B
13 1  A
14 3  B
15 3  A
16 5  B
17 5  A
18 6  B
19 2  A
20 5  B
 is.data.frame(test)
[1] TRUE
 is.numeric(test$ozone)
[1] TRUE
 is.factor(test$garden)
[1] TRUE
 lm(ozone~garden)
Error in model.frame.default(formula = ozone ~ garden, drop.unused.levels = 
TRUE) :
  invalid type (list) for variable 'ozone'

 attach(test)
 is.numeric(ozone)
[1] FALSE
 is.numeric(test$ozone)
[1] TRUE

[[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] Sub-Directories

2012-07-26 Thread Michael Grant
I've searched hard in texts, email threads, FAQs etc. and cannot find out how 
to successfully utilize sub-directories below my WorkingDirectory.  I can 
create them, and create R objects within the sub-directories but (a) the 
objects() command lists ONLY the objects in the WorkingDirectory and none of 
those in the sub-directory although I can use them (if I remember their 
names!).  I'm an old (and I do mean old!) UNIX user now working in a Windows 
environment.  I'm sure there is a simple way to do this but I seem unable to 
discover it.  I'd like to have several different 'projects' going at the same 
time, with each being unrecognized by the other within R.

Many thanks,
Michael Grant

[[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] Testing non-exhaustive Null and Alternative Hypothesis

2011-09-07 Thread Michael Grant
I wish to test the hypothesis of mu equal to or less than 5 against the 
specific alternative mu equal to or greater than 7.  I am unable to find how to 
persuade R to do this with any function (e.g. t.test).  Suggestions?

Michael Grant

[[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] choose.dir() gone?

2010-09-08 Thread Michael Grant
Maybe 'tk_choose.dir' in the tcltk package will do what you want.

--- On Wed, 9/8/10, Johannes Graumann johannes_graum...@web.de wrote:

 From: Johannes Graumann johannes_graum...@web.de
 Subject: Re: [R] choose.dir() gone?
 To: r-h...@stat.math.ethz.ch
 Date: Wednesday, September 8, 2010, 3:18 AM
 OK. Just checked and
 choose.file/choose.dir exists in the windows 
 version - apparently not in the linux one ... does anybody
 have a nice 
 platform-agnostic solution for this?
 
 Thanks, Joh
 
 Johannes Graumann wrote:
 
  Hi,
  
  I fail to find choose.dir() in my current R install
 (see below)? Didn't
  that exist at some point? How to achieve
 file.choose() equivalent
  functionality for directories?
  
  Thanks for any hints, Joh
  
  sessionInfo()
  R version 2.11.1 (2010-05-31)
  x86_64-pc-linux-gnu
  
  locale:
   [1] LC_CTYPE=en_US.UTF-8     
     LC_NUMERIC=C
   [3] LC_TIME=en_US.UTF-8     
      LC_COLLATE=en_US.UTF-8
   [5] LC_MONETARY=en_US.UTF-8   
    LC_MESSAGES=en_US.UTF-8
   [7] LC_PAPER=en_US.UTF-8     
     LC_NAME=en_US.UTF-8
   [9] LC_ADDRESS=en_US.UTF-8     
   LC_TELEPHONE=en_US.UTF-8
  [11] LC_MEASUREMENT=en_US.UTF-8   
 LC_IDENTIFICATION=en_US.UTF-8
  
  attached base packages:
  [1] stats     graphics 
 grDevices utils     datasets 
 methods   base
  
  other attached packages:
  [1] rkward_0.5.3
  
  loaded via a namespace (and not attached):
  [1] tools_2.11.1
 
 __
 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.


Re: [R] annotating a filled contours plot with a grid of points

2009-02-06 Thread Michael Grant
Dario,

Checkout the 'plot.axes' argument to 'filled.contour'.

Michael Grant


--- On Fri, 2/6/09, Dario Martin-Benito dmar...@inia.es wrote:

 From: Dario Martin-Benito dmar...@inia.es
 Subject: [R] annotating a filled contours plot with a grid of points
 To: r-help@r-project.org
 Date: Friday, February 6, 2009, 8:23 AM
 Dear R-help members,
 
 I am trying to plot annotate a filled contours plot (with
 filled.contour)
 with a grid of points. I have read ways of annotating it
 with individual
 points but not with grids in another matrix. 
 
  
 
 Any ideas?
 
  
 
 Thank you very much.
 
  
 
 Dario
 
 ___
 Dario Martin-Benito   
 CIFOR-INIA 
 Dpto. Sistemas y Recursos Forestales
 Ctra. La Coruña, Km. 7.5
 E-28040 Madrid (Spain )
 Tel.: +34 91 347 1461 
 e-mail: dmar...@inia.es /// dmartinben...@gmail.com
 
 http://dmartinbenito.googlepages.com
 
 
 
 
   [[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@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] Incorrect p value for binom.test?

2009-02-05 Thread Michael Grant
I believe the binom.test procedure is producing one tailed p values
rather than the two tailed value implied by the alternative hypothesis
language.  A textbook and SAS both show 2*9.94e-07 = 1.988e-06 as the
two tailed value.  As does the R summation syntax from R below.  It
looks to me like the alternative hypothesis language should be revised
to something like  ... greater than or equal to ...  Am I mistaken?

 

M.C.Grant

 

 2*sum(dbinom(c(10:25),25,0.061))

[1] 1.987976e-06

 

 binom.test(10,25,0.061)

 

Exact binomial test

 

data:  10 and 25 

number of successes = 10, number of trials = 25, p-value = 9.94e-07

alternative hypothesis: true probability of success is not equal to
0.061 

95 percent confidence interval:

 0.2112548 0.6133465 

sample estimates:

probability of success 

   0.4


[[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] 3D trajectory plot?

2008-11-15 Thread Michael Grant
Are you talking about a 'streamline' like might be made with 'vtk'? or in a 
number of fluid dynamics, groundwater packages, particle physics codes, etc.? 
There was an exploratory hook up of R and vtk by M. Kondrin a year or two back 
(linux only). Search the archives. Parsing a vtk dataset in R should relatively 
straight-forward.

HTH
Michael Grant



--- On Tue, 11/11/08, Chris Jarman [EMAIL PROTECTED] wrote:

 From: Chris Jarman [EMAIL PROTECTED]
 Subject: [R] 3D trajectory plot?
 To: r-help@r-project.org
 Date: Tuesday, November 11, 2008, 9:55 PM
 Hello,
 I'm attempting to create a smooth, 3D plot of a
 trajectory (rather
 than the cloud or wireframe functions).  I would rather the
 individual
 data points not be visible.  I've had no luck finding
 this on the
 graphics or help pages.  Thank you in advance.  Chris
 Some example data, just in case:
 
 2532  40
 1225  32
 2 12  25
 2 2   12
 202   2
 1 20  2
 6 1   20
 5 6   1
 5 5   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-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] Bug in is ?

2008-09-29 Thread Michael Grant

Tie a rock to the 7 and tie another rock of equal mass to the 7.0. Throw them 
both into opposite ends of a large pond on the first Tuesday after after a new 
moon. If the former number floats it is not the integer 10. If the latter 
floats it likely is not the larger integer 13. This is because of the greater 
buoyancy of the '0'. Divide the difference (13-10) into 1 and you have 1/3, but 
you do not have 7 or even 7.0. Since this result is neither '7' nor '7.0', it 
absolutely must be a '7.'.  This is why pi is irrational. 

Now, I hope that settles everything. It is easily demonstrated in four and a 
half lines of R code or one line of APL.

HTH :O)
Michael Grant








--- On Mon, 9/29/08, Lucke, Joseph F [EMAIL PROTECTED] wrote:

 From: Lucke, Joseph F [EMAIL PROTECTED]
 Subject: Re: [R] Bug in is ?
 To: Stefan Evert [EMAIL PROTECTED], R-help Mailing List 
 r-help@r-project.org
 Date: Monday, September 29, 2008, 10:24 AM
 Stefan
 You are right.  Briefly put, the existence of 7 requires
 only Peano's
 axiom for successive integers.  Strictly speaking, 7 is not
 an integer
 but a natural number. But natural numbers can be embedded
 in the
 integers which can be embedded in the rationals which can
 be embedded
 the reals which can be embedded in the complex. Little of
 this is
 relevant to a programming language's two basic storage
 modes for
 numbers. Confusing a variable type with a mathematical set
 is an
 elementary, if entertaining, logical error.
 Joe
 
 -Original Message-
 From: [EMAIL PROTECTED]
 [mailto:[EMAIL PROTECTED]
 On Behalf Of Stefan Evert
 Sent: Saturday, September 27, 2008 12:27 PM
 To: R-help Mailing List
 Subject: Re: [R] Bug in is ?
 
 Hi everyone!
 
 Sorry for taking an already overlong discussion thread
 slightly off-
 topic, but ...
 
  quote:
  No doubt, 7.0 is integer in math. But if people can
 write 7 why people
 
  need to write 7.0 (I do not see any reason to do
 this).
  endquote
 
  What is true in mathematics is not necessarily true in
 R.
 
 ... am I the only one who thinks that the integer 7 is
 something
 entirely different from the real number 7.0? (The latter
 most likely
 being an equivalence class of sequences of rational
 numbers, but that
 depends on your axiomatisation of real numbers.) Integers
 can be
 embedded in the set of real numbers, but that doesn't
 make them the same
 mathematically.
 
 So the original complaint should really have said that
 is.integer()
 doesn't do what a naive user (i.e. someone without a
 background in
 computer science or maths) might expect it to do. :-)
 
 That said, I've fallen into the same trap more than
 once, and painfully,
 myself (often in connection with MySQL).
 
 
 Best wishes, and with a tiny grain of salt, Stefan Evert
 
 [ [EMAIL PROTECTED] | http://purl.org/stefan.evert ]
 
 
 
 
   [[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@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.


Re: [R] model II regression - how do I do it?

2008-08-29 Thread Michael Grant
Dear Danilo:

Here is one approach with the formal reference being:

Computational Statistics  Data Analysis 23 ( 1997 ) 355-372
COMPUTATIONAL
STATISTICS
 DATA ANALYSIS
Generalization of the geometric mean
functional relationship
Norman R. Draper, Yonghong (Fred) Yang
Department of Statistics, 1210 West Dayton Street, Madison, WI 53706-1685, USA
Received February 1995; revised February 1996

Here is the S version of their program (for two predictor variables):

Appendix

The Splus code has been used to specify the weight functions and fit the model:
Specify the weight function:
weight  - function(y,x 1,x2,b0,b 1,b2)
{
pred -b0+b l*x 1 ÷b2*x2
parms -abs(b 1b2)^(1/3)
(y-pred)/parms
}
Fit the model
gmfit  -nls(~weight(y,x 1,x2,b0,b 1,b2),
observe,list(starting value))


Hope this helps.
MCG

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Danilo Muniz
Sent: Friday, August 29, 2008 11:37 AM
To: r-help@r-project.org
Subject: [R] model II regression - how do I do it?

I need to do a model II linear regression, but I could not find out how!!

I tryed to use the lm function, but I did not discovered how to specify the
model (type I or type II) to the function... could you help me?

-- 
Danilo Muniz
[Gruingas Abdiel]

[[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@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] piper diagram

2008-06-12 Thread Michael Grant
Sorry no previous message text or addresses, but I just cleaned my mailbox
and then found something relevant. Regarding the Piper diagram. I just
noticed the 'hydrogeo' package on CRAN, courtesy of one Myles English. That
should be what you need or close to it. 

 

Best regards,

Michael Grant


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