Peter Gaffney | 1 Jul 2004 01:32
Picon
Favicon

[R] linear models and colinear variables...

Hi!

I'm having some issues on both conceptual and
technical levels for selecting the right combination
of variables for this model I'm working on. The basic,
all inclusive form looks like

lm(mic ~ B * D * S * U * V * ICU)

Where mic, U, V, and ICU are numeric values and B D
and S are factors with about 16, 16 and 2 levels
respectively. In short, there's a ton of actual
explanatory variables that look something like this:

Bstaph.aureus:Dvan:Sr:U:ICU

There are a good number of hits but there's also a
staggering number of complete misses, due to a
combination of scare data in that particular niche and
actual lack of deviation from the categorical mean. 
My suspicion is that there's a large degree of
colinearity in some of these variables that serves to
reduce the total effect of either of a nearly colinear
pair to an insignificant level; my hope is that
removing one of a mostly colinear group would allow
the other variables' possibly significant effects to
be measured.

Question 1) Is this legitimate at all? Can I do
regression using the entire data set over only
(Continue reading)

Michael Axelrod | 1 Jul 2004 01:44

[R] R can find some functions in assist package

I am a new user to R. I installed and loaded the smoothing spline package 
called "assist." The function "ssr" seems to work, but "predict.ssr" and 
some others don't seem to be available, I get a "can't find" message. But 
they appear in the extensions folder, c:program 
files\R\rw1091\library\assist\R-ex. What's wrong?

______________________________________________
R-help <at> stat.math.ethz.ch mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html

Jonathan Baron | 1 Jul 2004 01:47

Re: [R] linear models and colinear variables...

On 06/30/04 16:32, Peter Gaffney wrote:
>Hi!
>
>I'm having some issues on both conceptual and
>technical levels for selecting the right combination
>of variables for this model I'm working on. The basic,
>all inclusive form looks like
>
>lm(mic ~ B * D * S * U * V * ICU)

When you do this, you are including all the interaction terms.
The * indicates an interaction, as opposed to +.  That might make
sense unders some circumstances, for example if you are just
trying to get the best model and you plan to eliminate
higher-order interactions that are not significant, but usually
it does more to obscure the interesting effects than to display
them.

>My suspicion is that there's a large degree of
>colinearity in some of these variables that serves to
>reduce the total effect of either of a nearly colinear
>pair to an insignificant level; my hope is that
>removing one of a mostly colinear group would allow
>the other variables' possibly significant effects to
>be measured.

There may be colinearity, but the most likely problem is that you
are including too many interactions, at too high a level.
Inclusion of nonsignificant interaction terms often turns
significant main effects into nonsignificant effects.
(Continue reading)

solares | 1 Jul 2004 01:55
Picon

[R] help with tclVar

Hi, I can' t load a variable tcltk declared with tclVar, why is this?, the
exmple above explain me ,Thanks Ruben
a<-tclVar(init="")
> f<-function(){
+ a<<-"pipo"
+ }
> f()
> a
[1] "pipo"
> tclvalue(a)
Error in structure(.External("dotTcl", ..., PACKAGE = "tcltk"), class =
"tclObj") :
        [tcl] can't read "pipo": no such variable.
>

______________________________________________
R-help <at> stat.math.ethz.ch mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html

Michael Axelrod | 1 Jul 2004 02:00

[R] R can't find some functions in assist package

Oh yes. The "load package" under the "packages menu" in the Windows version 
does that. To check I typed "library(assist)" after starting R. Same 
behavior, ssr is found, but others like predict.ssr, and plot.ssr, give a 
"not found" message.

Thanks for the suggestion.

Mike

______________________________________________
R-help <at> stat.math.ethz.ch mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html

James.Callahan | 1 Jul 2004 02:08
Favicon

[R] MS OLAP -- RODBC to SQL Server "Slice Server" pass-through query to MS OLAP

Olivier Collignon wrote:
> I have been doing data analysis/modeling in R, connecting to SQL 
databases 
> with RODBC (winXP client with R1.9.0 and win2k SQL server 2000).
> 
> I am now trying to leverage some of the OLAP features to keep the data 
> intensive tasks on the DB server side and only keep the analytical tasks 

> within R (optimize use of memory). Is there any package that would allow 
to 
> connect to OLAP cubes (as a client to SQL Analysis Services PivotTable 
> Service) from an R session (similar to the RODBC package)?
> 
> Can this be done directly with special connection parameters (from R) 
> through the RODBC package or do I have to setup an intermediary XL table 

> (pivottable linked to the OLAP cube) and then connect to the XL data 
source 
> from R?
> 
> I would appreciate any reference / pointer to OLAP/R configuration 
> instructions. Thanks.
> 
> Olivier Collignon

OLAP = On-line Analytical Processing == Using a cube / hypercube of data 
for decision support 
(usually extracted from an transaction processing system)

Direct connection to Microsoft OLAP server ("Analysis Services") requires 
(Continue reading)

Jason Turner | 1 Jul 2004 03:02
Picon

Re: [R] R can't find some functions in assist package

> Oh yes. The "load package" under the "packages menu" in the Windows
> version
> does that. To check I typed "library(assist)" after starting R. Same
> behavior, ssr is found, but others like predict.ssr, and plot.ssr, give a
> "not found" message.

Short answer:  Try using "predict" instead of "predict.ssr".  I think
you're meant to quietly use the predict and plot methods provided, and not
mention their inner names.

Long answer:
Namespaces.  This means that a method for an object isn't visible to R as
a whole.  This avoids conflics should another package pick the same names.

Does this work?

getAnywhere(predict.ssr)

Cheers

Jason

______________________________________________
R-help <at> stat.math.ethz.ch mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html

Liaw, Andy | 1 Jul 2004 03:03
Picon
Favicon

RE: [R] R can't find some functions in assist package

That's because `assist' has a namespace:

> library(assist)
Loading required package: nlme 
> predict.ssr
Error: Object "predict.ssr" not found
> methods("predict")
 [1] predict.ar*                predict.Arima*            
 [3] predict.arima0*            predict.glm               
 [5] predict.gls*               predict.gnls*             
 [7] predict.HoltWinters*       predict.lm                
 [9] predict.lme*               predict.lmList*           
[11] predict.loess*             predict.mlm               
[13] predict.nlme*              predict.nls*              
[15] predict.poly               predict.ppr*              
[17] predict.princomp*          predict.slm*              
[19] predict.smooth.spline*     predict.smooth.spline.fit*
[21] predict.snm*               predict.snr*              
[23] predict.ssr*               predict.StructTS*         

    Non-visible functions are asterisked

Use either assist:::predict.ssr or getAnywhere("predict.ssr").

Andy

> From: Michael Axelrod
> 
> Oh yes. The "load package" under the "packages menu" in the 
> Windows version 
(Continue reading)

roger koenker | 1 Jul 2004 03:22
Picon

Re: [R] R can't find some functions in assist package

An R-News or J. of Statistical Software note titled, "Getting to the 
Source
of the Problem"  detailing the basic strategies for these adventures in 
the
new world of S4 methods and namespaces would be very useful.

url:	www.econ.uiuc.edu/~roger        	Roger Koenker
email	rkoenker <at> uiuc.edu			Department of Economics
vox: 	217-333-4558				University of Illinois
fax:   	217-244-6678				Champaign, IL 61820

On Jun 30, 2004, at 8:03 PM, Liaw, Andy wrote:

> That's because `assist' has a namespace:
>
>> library(assist)
> Loading required package: nlme
>> predict.ssr
> Error: Object "predict.ssr" not found
>> methods("predict")
>  [1] predict.ar*                predict.Arima*
>  [3] predict.arima0*            predict.glm
>  [5] predict.gls*               predict.gnls*
>  [7] predict.HoltWinters*       predict.lm
>  [9] predict.lme*               predict.lmList*
> [11] predict.loess*             predict.mlm
> [13] predict.nlme*              predict.nls*
> [15] predict.poly               predict.ppr*
> [17] predict.princomp*          predict.slm*
> [19] predict.smooth.spline*     predict.smooth.spline.fit*
(Continue reading)

Liaw, Andy | 1 Jul 2004 03:46
Picon
Favicon

RE: [R] Developing functions

> From: daniel <at> sintesys.com.ar
> 
> Hi,
> I´m new in R. I´m working with similarity coefficients for clustering
> items. I created one function (coef), to calculate the 
> coefficients from
> two pairs of vectors and then, as an example, the function
> simple_matching,
> taking a data.frame(X) and using coef in a for cicle.
> It works, but I believe it is a bad way to do so (I believe 
> the for cicle
> is not necessary). Somebody can suggest anything better.
> Thanks
> Daniel Rozengardt
> 
> coef<-function(x1,x2){a<-sum(ifelse(x1==1&x2==1,1,0));
> b<-sum(ifelse(x1==1&x2==0,1,0));
> c<-sum(ifelse(x1==0&x2==1,1,0));
> d<-sum(ifelse(x1==0&x2==0,1,0));
> ret<-cbind(a,b,c,d);
> ret
> }
> 
> simple_matching<-function(X) {
> ret<-matrix(ncol=dim(X)[1],nrow=dim(X)[1]);
> diag(ret)<-1;
> for (i in 2:length(X[,1])) {
> 	for (j in i:length(X[,1])) {
> 	vec<-coef(X[i-1,],X[j,]);
> 	result<-(vec[1]+vec[3])/sum(vec);
(Continue reading)


Gmane