Re: [R] Latent Class Analyisis in R

2005-04-18 Thread Tim F Liao
Helen,

You may consider using LCA 1.1, written by Niels Waller at
Vanderbilt University.  You may need to get it from his
website at Vanderbilt instead of CRAN, at least it was the
case in the past.

Tim Liao

 Original message 
Date: Mon, 18 Apr 2005 12:29:41 -0400
From: Dennis, Helen [EMAIL PROTECTED]  
Subject: [R] Latent Class Analyisis in R  
To: r-help@stat.math.ethz.ch

Hi,

I am new to R. I would like to know if there is a package
available that
will estimate a 2-class Latent Class Analysis, with trichotomous
observed variables, some of which are free to covary.  

I have read the PDF files regarding the e1071 and gllm
packages, but it
appears that these only allow dichotomous measured variables,
and it is
not clear to me whether they allow the measured variables to
covary.

Thanks!

Helen Dennis
Education Associate
Assessment and Analysis Group
Delaware Dept. of Education
401 Federal Street
Suite 2
Dover, DE 19707
[EMAIL PROTECTED]
tel: 302-739-6700
fax: 302-739-3092

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

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


Re: [R] problem with logistic regression

2005-02-07 Thread Tim F Liao
Helene,

The problem is not with R, but with the specification of the
SAS procedure you used.  It would be simpler and more
comparable if you specify your model in SAS with Proc Logistic
or Proc Genmod.

See if they work out for you,

Tim

 Original message 
Date: Mon,  7 Feb 2005 17:19:54 +0100
From: [EMAIL PROTECTED]  
Subject: [R] problem with logistic regression  
To: r-help@stat.math.ethz.ch
Cc: [EMAIL PROTECTED]

Hi,

we try to do a logistic regression with the function glm.
But we notice that this function don't give the same results
as the SAS proc
catmod (differents estimate given).
We try to change the contrast on R system with:

options(contrasts=c(unordered=contr.SAS,ordered=contr.poly))

We also try with brlr and logistf functions.
Unfortunately, the estimate aren't still the same.

Please could someone help us.

Thank you

--
This mail sent through Polytech'Lille WebMail (IMP)

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

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


Re: [R] Std Err on Concentration measures

2005-02-05 Thread Tim F Liao
David Giles has a paper on calculating standard errors for the
Gini: http://web.uvic.ca/econ/ewp0202.pdf

Tim

 Original message 
Date: Sat, 5 Feb 2005 11:43:02 +0100
From: Angelo Secchi [EMAIL PROTECTED]  
Subject: [R] Std Err on Concentration measures  
To: r-help@stat.math.ethz.ch


Hi,
I'm using the ineq package to calculate some concentration
measures (Gini, Herfindal, ...) and I was wondering if there's
around also a function to calculate standard error on these
measures. If not, is anybody aware of where I can find a
reference on this point?
Thanks.

-- 

 Angelo Secchi PGP Key ID:EA280337

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

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


RE: [R] GLM fitting

2005-01-28 Thread Tim F Liao
To push the point a bit further, Vito, if you allow just a bit
variation in the data by changing one of the y=1 cases to 0 or
one of the y=0 cases to 1, then you'll be able to fit the glm
model.  If these are real-world data and if you still want to
describe them, then a deterministic statement

y=1 if xa
y=0 if x=a

where a can be any value between 29 and 33

would work because there is no uncertainty in the model (other
than the exact location of a).

Tim

 Original message 
Date: Fri, 28 Jan 2005 09:55:53 -0500
From: Charles Annis, P.E.
[EMAIL PROTECTED]  
Subject: RE: [R] GLM fitting  
To: 'Vito Ricci' [EMAIL PROTECTED],
r-help@stat.math.ethz.ch

Vito:

Please plot your data:

y - c(1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0)
x - c(37, 35, 33, 40, 45, 41, 42, 20, 21, 25, 27, 29, 18)
plot(x, y)

You will see that ANY step function between 29  x  33 will
describe these
observations perfectly.


Charles Annis, P.E.
 
[EMAIL PROTECTED]
phone: 561-352-9699
eFax:  614-455-3265
http://www.StatisticalEngineering.com

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Vito Ricci
Sent: Friday, January 28, 2005 5:14 AM
To: r-help@stat.math.ethz.ch
Subject: [R] GLM fitting

DeaR R-useRs,

I'm trying to fit a logist model with these data:

 dati
   y  x
1  1 37
2  1 35
3  1 33
4  1 40
5  1 45
6  1 41
7  1 42
8  0 20
9  0 21
10 0 25
11 0 27
12 0 29
13 0 18

I use glm(), having this output:

 g-glm(y~x,family=binomial,data=dati)
Warning messages: 
1: Algorithm did not converge in: glm.fit(x = X, y =
Y, weights = weights, start = start, etastart =
etastart,  
2: fitted probabilities numerically 0 or 1 occurred
in: glm.fit(x = X, y = Y, weights = weights, start =
start, etastart = etastart,  
 g

Call:  glm(formula = y ~ x, family = binomial, data =
dati) 

Coefficients:
(Intercept)x  
-348.2311.23  

Degrees of Freedom: 12 Total (i.e. Null);  11 Residual
Null Deviance:  17.94 
Residual Deviance: 7.011e-10AIC: 4 

I don't understand the meaning of warning. Can anyone
help me? Many thanks.
Cheers,
Vito


=
Diventare costruttori di soluzioni
Became solutions' constructors

The business of the statistician is to catalyze 
the scientific learning process.  
George E. P. Box

Top 10 reasons to become a Statistician

 1. Deviation is considered normal
 2. We feel complete and sufficient
 3. We are 'mean' lovers
 4. Statisticians do it discretely and continuously
 5. We are right 95% of the time
 6. We can legally comment on someone's posterior
distribution
 7. We may not be normal, but we are transformable
 8. We never have to say we are certain
 9. We are honestly significantly different
10. No one wants our jobs


Visitate il portale http://www.modugno.it/
e in particolare la sezione su Palese
http://www.modugno.it/archivio/palese/

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

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

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


Re: [R] Linear Trend Analysis?

2005-01-26 Thread Tim F Liao
Chris,

While there might be certain functions in R that I'm not aware
of for such purposes, anything (well, almost) can be done in R
if you're willing to write a line or two of code, and that's
the beauty of R.  In a course I recently taught, I used the
following code to generate individual data from grouped data,
which would give the same results as using fweight=count in Stata.

Ind.Data-data.frame(cbind(rep(Y,freq),rep(X1,freq),rep(X2,freq)))

where Y is the dependent variables and X1 and X2 are two
explanatory variables and freq is your count variable.

Hope this helps,

Tim F Liao
Professor of Sociology  Statistics
University of Illinois
Urbana, IL 61801

 Original message 
Date: Wed, 26 Jan 2005 12:54:11 -0600
From: Chris Bergstresser [EMAIL PROTECTED]  
Subject: [R] Linear Trend Analysis?  
To: R-help@stat.math.ethz.ch

Hi all --

   I'm trying to use R for my Analysis of Categorical Data
class, but I
can't figure out how to do a weighted linear trend analysis.
 I have a table
of categorical data, to which I've assigned weights to the
rows and columns.
I need to calculate r and M^2, which is apparently done in
SAS using PROC
FREQ and in STATA using correlate var1 var2 fw=count. 
What's the command
for R?

-- Chris

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

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


Re: [R] Need help to transform data into co-occurence matix

2005-01-20 Thread Tim F Liao
Judie,

You may want to see if the MedlineR library, which has a
program for constructing co-occurrence matrices, will work for
you.  The program can be found at:

http://dbsr.duke.edu/pub/MedlineR/

Have fun with it,

Tim Liao
Professor of Sociology  Statistics
University of Illinois
Urbana, IL 61801

 Original message 
Date: Thu, 20 Jan 2005 18:19:19 -0800 (PST)
From: Judie Z [EMAIL PROTECTED]  
Subject: [R] Need help to transform data into co-occurence
matix  
To: r-help@stat.math.ethz.ch

Dear R experts,
I have the data in the following fomat(from some kind of card
sorting process)
 
ID  Category   Card numbers
1   1   1,2,5
1   2   3,4
2   1   1,2
2   2   3
2   3   4,5
 
I want to transform this data into two co-occurence matrix
(one for each ID)
-- For ID 1
   1 2 3 4 5
1 1 1 0 0 1
2 1 1 0 0 1
3 0 0 1 1 0
4 0 0 1 1 0
5 1 1 0 0 1
 
-- For ID 2
   1 2 3 4 5
1  1 1 0 0 0
2  1 1 0 0 0
3  0 0 1 0 0 
4  0 0 0 1 1
5  0 0 0 1 1
 
The columns and rows are representing the card numbers. All
0s mean the card numbers are not in the same category, vice
versa.
 
Is there any way I can to this in R?
I would really appreciate your help. 
 
Judie, Tie
 
 

   
-


   [[alternative HTML version deleted]]

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

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


Re: [R] GAM: Remedial measures

2005-01-13 Thread Tim F Liao
Jean,

The standard treatment of overdispersed data when using the
Poisson distribution to model count data is to switch to the
negative binomial distribution.  Hope this helps,

Tim Liao

 Original message 
Date: Thu, 13 Jan 2005 18:22:29 -0500
From: Jean G. Orelien [EMAIL PROTECTED]  
Subject: [R] GAM: Remedial measures  
To: r-help@stat.math.ethz.ch

I fitted a GAM model with Poisson distribution to a data with
about 200
observations.  I noticed that the plot of the residuals
versus fitted values
show a trend.  Residuals tend to be lower for higher fitted
values. Because,
I'm dealing with count data, I'm thinking that this might be
due to
overdispersion.  Is there a way to account for overdispersion
in any of the
packages MGCV or GAM?  

 

I welcome any suggestions that one may have on this topic.

 

Jean

 


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

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


Re: [R] doing many commands within R

2005-01-10 Thread Tim F Liao
Sounds like you've got a file referencing problem.  You may
want to try and input the file into R using a simple
read.table command or something similar without yet running
your long script to see if your file can be called up.

Tim

 Original message 
Date: Mon, 10 Jan 2005 13:55:28 +0100 (CET)
From: Cserhti Mtys [EMAIL PROTECTED]  
Subject: [R] doing many commands within R  
To: r-help@stat.math.ethz.ch



Dear all,

I'm new to this list, so let me greet everyone.

My problem is that I have several thousand data files which I
want to 
perform a lot of R commands on, which are found in a seperate
.R script.

Now, what I did was within the R prompt, I used to read in a
list of the 
data files. 

e.g. 

namelist - readLines(list_of_names,n=-1)
for (i in 1:100) {
k - function(namelist[i])
write(k,file=outputfile,append=TRUE)
}

Next, I tried automating the R commands by making a loop.
Within the 
loop I called the R-script. Within ecery single loop R called
the R-script 
and performs the commands therein (or is supposed to perform
it) on 
the actual data file.

After a loop finished, I tried appending the output to an
output file.

The problem is that R gives an error message saying that it
cannot 
open the input files.

What can I do?

Thanks, Matthew

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

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


Re: [R] Calculate Mean of Column Vectors?

2005-01-10 Thread Tim F Liao
Tom,

I often use a loop, such as:

m - rep(0,1000)
 for (i in 1:1000)
+ m[i]-mean(y[,i])
 m[1:20]
 [1] -0.04914724 -0.28253861 -0.31112690 -0.18034371 
0.18839167  0.66448244
 [7]  0.19769017 -1.28363405 -0.05167451 -0.95492534
-1.23285174  0.10288562
[13] -0.73792584 -0.19297468 -0.59059036 -0.11870173 
0.38285449  1.19154411
[19]  0.34663980  0.21322554

But there may be more efficient ways to accomplish this.

Tim


 Original message 
Date: Mon, 10 Jan 2005 22:45:56 -0500
From: Thomas Hopper [EMAIL PROTECTED]  
Subject: [R] Calculate Mean of Column Vectors?  
To: r-help@stat.math.ethz.ch

Hello,

I've got an array defined as y - rnorm(3000), dim(y) - c(3,
1000).

I'd like to produce a 1000-element vector z that is the mean
of the 
corresponding elements of y (like z[1,1] - mean(y[1,1], y[2,1], 
y[3,1])), but being new to R, I'm not sure how to do this for
all 
elements at once (or, at least, simply). Any help is appreciated.

Thanks,

Tom

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

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


Re: [R] Segmentation fault while using Mclust function of mclust library in R-2.0.1

2005-01-06 Thread Tim F Liao
Tae-Hoon,

Your code worked with version 1.90:

 Mclust(rnorm(100))

 best model: univariate normal with 1 groups

 averge/median classification uncertainty: 0 / 0 

Warning message: 
optimal number of clusters occurs at min choice in: Mclust
(rnorm(100)) 

The warning should be there because the data you generated 
have only one cluster.  I'm fairly certain it would work 
with R version 2.0 as well which is what I have on my home 
computer and I used Mclust for one-dimensional data last 
month with that version.  If it's a problem with the latest 
version, you can simply download an earlier version of R 
(yesterday there was a thread about where to find version 
1.91 or something like it) and run Mclust with that version.

Tim Liao
Professor of Sociology  Statistics
University of Illinois

 Original message 
Date: Thu, 06 Jan 2005 02:20:15 -0700
From: Tae-Hoon Chung [EMAIL PROTECTED]  
Subject: [R] Segmentation fault while using Mclust function 
of mclust library in R-2.0.1  
To: r-help@stat.math.ethz.ch r-help@stat.math.ethz.ch

Hi, all;

I got an unusual error while using mclust library 2.1-7 on 
R 2.0.1.
When I tried to run Mclust(rnorm(100)), I got segmentation 
fault error.
Does anyone know what causes this problem?
I came across the same problem even when I tried to run the 
example shown in
Mclust help using iris data.

Thanks in advance,
Tae-Hoon Chung
--
Tae-Hoon Chung
Post-Doctoral Researcher
Translational Genomics Research Institute (TGen)
445 N. 5th Street (Suite 530)
Phoenix, AZ 85004
1-602-343-8724 (Direct)
1-480-323-9820 (Mobile)
1-602-343-8840 (Fax)

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

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


Re: [R] How to avoid rounding of matrix elements?

2005-01-06 Thread Tim F Liao
The signif() function doesn't increase the number 
significant digits beyond the default.  However, if your 
purpose is simply to see more digits (or what was entered), 
a paste() function will do the trick though it will trim the 
trailing zeros.  Other ways?

Tim

 Original message 
Date: Thu, 06 Jan 2005 18:57:03 -0500
From: Ulas Karaoz [EMAIL PROTECTED]  
Subject: [R] How to avoid rounding of matrix elements?  
To: R-help@stat.math.ethz.ch

Hi all R-users,
If I have a matrix with numeric elements as follows, the 
values are 
rounded when I try to refer to a specifici element using 
[], the value 
is rounded.
The same thing happens if the matrix is read from a file, 
the values are 
stored to the correct precision but then when I try to 
refer to a 
specific element (such as using [], it is rounded.

How do I avoid this rounding?
 mdat-matrix(c
(0.0187972950,0.4446208550,1.00,0.0003204380,0.010500
2420,1.1087556380,0.0742164230,0.0362898240), 
nrow = 2, ncol=4)
  mdat
   [,1][,2]   [,3]   [,4]
[1,] 0.01879729 1.0 0.01050024 0.07421642
[2,] 0.44462085 0.000320438 1.10875564 0.03628982

Thanks.

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

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


Re: [R] plots

2004-12-28 Thread Tim F Liao
You can copy (right click then choose metafile) and paste 
into Word easily, though sometimes you may have problem 
sizing the graph, depending on how it's produced.  However, 
single framed graphs work quite straightforwardly.

Tim Liao

 Original message 
Date: Mon, 27 Dec 2004 17:00:19 -0800 (PST)
From: duraikannan sundaramoorthi [EMAIL PROTECTED]  
Subject: [R] plots  
To: r-help@stat.math.ethz.ch

Is there a way to save plots and use in a word
document. Thanks for your help in advance.
durai


   
__ 

Send holiday email and support a worthy cause. Do good.

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

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


Re: [R] violinplot options

2004-11-17 Thread Tim F Liao
Uwe is right.  You can add titles quite easily.  
Specifically, you can use title(main=...,ylab=...) and 
that will do the trick after you have used vioplot to do the 
plot.

Tim Liao

 Original message 
Date: Wed, 17 Nov 2004 10:55:33 +0100
From: Uwe Ligges [EMAIL PROTECTED]  
Subject: Re: [R] violinplot options  
To: Tanja Zseby [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]

Tanja Zseby wrote:

 Hi,
 
 I am using the function  vioplot() to generate violin 
plots. Now I would 
 like to add a label to the y axix and a title to the 
diagram.
 Just setting ylab didnt work. Is it possible to set such 
options for the 
 function ?
 I tried also with the function simple.violinplot, but 
also with this I 
 couldnt set the options.
 
 Kind Regards
 Tanja

Looks like nobody else has responded so far.
If you are talking about the function in the package also 
called 
vioplot: The function is not very well designed. But 
since there is 
not much code in it, it is quite easy to add additional 
functionality 
yourself by adapting the whole function.

Uwe Ligges




 __
 [EMAIL PROTECTED] mailing list
 https://stat.ethz.ch/mailman/listinfo/r-help
 PLEASE do read the posting guide! 
 http://www.R-project.org/posting-guide.html

__
[EMAIL PROTECTED] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-
project.org/posting-guide.html

__
[EMAIL PROTECTED] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


Re: [R] help on EM Algorithm for bivariate normal

2004-11-16 Thread Tim F Liao
The three packages that someone else mentioned in response 
to your post

flexmix
mixreg
mclust

may be usefule in real applications.  On the other hand, if 
your interest is in teaching EM or developing your own EM by 
using a simple example, the most recent issue of The 
American Statistician has an article with a sample R code 
for the purpose.  Right now I'm away from my journal.  But 
if you would want further info, let me know and I can find 
it for you.

Tim Liao

 Original message 
Date: Tue, 16 Nov 2004 18:22:07 +0100
From: [EMAIL PROTECTED]  
Subject: [R] help on EM Algorithm for bivariate normal  
To: [EMAIL PROTECTED]


Hi,
I woul like to know if it is possible to have a R code to 
generate EM
Algorithm for a normal bivariate mixture.
Best regard,
S.F.

__
[EMAIL PROTECTED] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-
project.org/posting-guide.html

__
[EMAIL PROTECTED] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


[R] glim in R?

2004-11-15 Thread Tim F Liao
After some futile searches, I decided to ask the list to see 
if any of the sages out there would have an answer:

I have a function I wrote a few years ago in S, which calls 
glim numerous times.  I'd like to port it to R, but glm 
works differently from glim, which takes as part of its 
input an X design matrix.  I probably could write a function 
to convert glim to glm, but hope this wouldn't be 
necessary...

Tim Liao

__
[EMAIL PROTECTED] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


Re: [R] glim in R?

2004-11-15 Thread Tim F Liao
Great suggestions, and it looks like either suggestion 
should work, although the output from glm may not conform to 
those from glim, thus some more code there perhaps.

Many thanks,

Tim

 Original message 
Date: Mon, 15 Nov 2004 14:28:50 -0400 (AST)
From: Rolf Turner [EMAIL PROTECTED]  
Subject: Re: [R] glim in R?  
To: [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]

Tim Liao wrote:

 After some futile searches, I decided to ask the list to 
see if any
 of the sages out there would have an answer:
 
 I have a function I wrote a few years ago in S, which 
calls glim
 numerous times.  I'd like to port it to R, but glm works 
differently
 from glim, which takes as part of its input an X design 
matrix.  I
 probably could write a function to convert glim to glm, 
but hope this
 wouldn't be necessary...

I doubt that you will get any joy in locating a glim() 
function for
R.  No-one would write one; that would be wheel-re-
invention given the
existence of glm().

The glim() function is antiquated and is or should be 
deprecated.
The technology has moved beyond that.  What you really 
should do is
re-write your code to call glm().

If it is ***really*** necessary to pass the design matrix, 
you should
be able to

   o convert that matrix to a data frame, say ``ddd''
   o call glm(formula,data=ddd)
   o the formula would presumably be simply something
 like ``y ~ .'' since the predictors would simply
 be all of the individual columns of your data 
frame.

I can't see this as being particularly difficult recoding.  
Or if you
insist, you could do just create your glim() function as:

   glim - function(y,X,...) {
   X - as.data.frame(X)
   glm(y~.,data=X,...)
   }

(I can't really remember the glim syntax, but ``glim
(y,X,...)'' is
a reasonable facsimile.)

If your design matrix has a constant column you would want 
to strip
it out before passing the matrix to you glim() function.

   cheers,

   Rolf Turner
   [EMAIL PROTECTED]

__
[EMAIL PROTECTED] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


Re: [R] Calling Other (non-C or Fortran) Programs from R

2004-11-13 Thread Tim F Liao
Here's my report on the issue:

The command 'system' combined with either 'scan' 
or 'read.table' (depending on what I want to do with the 
output in each step) worked beautifully.

Cheers,

Tim Liao

__
[EMAIL PROTECTED] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


Re: [R] Calling Other (non-C or Fortran) Programs from R

2004-11-08 Thread Tim F Liao
Thanks to both Duncan Murdoch and Brian Ripley.  LEM indeed 
is the program that Brian referred to in his response, a 
program for latent class/trait loglinear and event history 
analysis compiled with Borland Pascal.  There's a dos 
version and a windows version.  Not sure the program will 
produce dll's, but I'll do a bit exploration and report back.

Tim Liao

 Original message 
Date: Sun, 7 Nov 2004 18:57:52 + (GMT)
From: Prof Brian Ripley [EMAIL PROTECTED]  
Subject: Re: [R] Calling Other (non-C or Fortran) Programs 
from R  
To: Duncan Murdoch [EMAIL PROTECTED]
Cc: Tim F Liao [EMAIL PROTECTED], [EMAIL PROTECTED]

On Sun, 7 Nov 2004, Duncan Murdoch wrote:

 On Sun, 7 Nov 2004 08:50:25 -0600, Tim F Liao 
[EMAIL PROTECTED] wrote:
 
 Hi!
 
 I wonder if anyone has experiences of calling other 
programs 
 from R (i.e., not C or Fortran programs).
 
 Specifically I want to call LEM from R and execute it in 
a 
 loop to process its output in R.  Thanks,
 
 I don't know what LEM is.  If it's a language that can 
produce DLLs or
 .so's, then it should be straightforward to call them.  
If it's a
 program using standard input and output, the system() 
function is what
 you want.

Nor do, I, but my guess is that it is the program referred 
to at

http://ourworld.compuserve.com/homepages/jsuebersax/soft.htm
#LEM

Perhaps Tim F Liao can enlighten us.

-- 
Brian D. Ripley,  [EMAIL PROTECTED]
Professor of Applied Statistics,  
http://www.stats.ox.ac.uk/~ripley/
University of Oxford, Tel:  +44 1865 272861 
(self)
1 South Parks Road, +44 1865 272866 (PA)
Oxford OX1 3TG, UKFax:  +44 1865 272595


__
[EMAIL PROTECTED] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


[R] Calling Other (non-C or Fortran) Programs from R

2004-11-07 Thread Tim F Liao
Hi!

I wonder if anyone has experiences of calling other programs 
from R (i.e., not C or Fortran programs).

Specifically I want to call LEM from R and execute it in a 
loop to process its output in R.  Thanks,

Tim Liao

__
[EMAIL PROTECTED] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html