Re: [R] Time Series Count Models

2005-07-18 Thread Paul Johnson
Dear Brett: There are books for this topic that are more narrowly tailored to your question. Lindsey's Models for Repeated Measurements and Diggle, et al's Analysis of Longitudinal Data. Lindsey offers an R package on his web site. If you dig around, you will find many modeling papers on

Re: [R] LyX and Sweave

2005-08-18 Thread Paul Johnson
I just wanted to point out that I was there first :) on the Lyx List (Nov 2004): http://www.mail-archive.com/lyx-users@lists.lyx.org/msg36262.html Perhaps somebody who is trying to put all of this together can benefit from both sets of explanations. pj [EMAIL PROTECTED] wrote: On Mon, 25

[R] Advice about system for installing updating all R package in a Linux Lab?

2005-08-19 Thread Paul Johnson
Good day: I'm administering 6 linux systems (FC4) in a student lab and worry that users may want packages that are not installed. I get tired of adding them one by one. Then I happened upon this page http://support.stat.ucla.edu/view.php?supportid=30 about installing all R packages from

[R] controlling where *.Rout gets printed. Possible?

2005-09-01 Thread Paul Johnson
-- And here's the R program -R_installAll.R- # Paul Johnson pauljohn _AT_ ku.edu 2005-08-31 # This should update and then install all packages, except for # ones I exclude because they don't work or we don't want them. options(repos = http

[R] controlling usage of digits scientific notation in R plots; postscript margins

2005-09-21 Thread Paul Johnson
Dear R users: I assigned students to make some graphs and I'm having trouble answering some questions that they have. We are all working on R 2.1 on Fedora Core Linux 4 systems. 1. In the plot, the axis is not labeled by numbers, but rather scientific notation like -2e+08 or such. We

Re: [R] Select varying LS digits in long numbers?

2005-10-04 Thread Paul Johnson
Maybe this is just the brute force you want to avoid, but it works to coerce the integer into a string, and then back to a number. Could reduce number of lines by nesting functions, of course. y - 1234131431 n - 3 ychar - as.character(y) ydigits - nchar(ychar) result - as.numeric (

[R] Ever see a stata import problem like this?

2004-09-21 Thread Paul Johnson
Greetings Everybody: I generated a 1.2MB dta file based on the general social survey with Stata8 for linux. The file can be re-opened with Stata, but when I bring it into R, it says all the values are missing for most of the variables. This dataset is called morgen.dta and I dropped a copy

followup: Re: [R] Issue with predict() for glm models

2004-09-23 Thread Paul Johnson
I have a follow up question that fits with this thread. Can you force an overlaid plot showing predicted values to follow the scaling of the axes of the plot over which it is laid? Here is an example based on linear regression, just for clarity. I have followed the procedure described below to

Re: [R] R glm

2004-09-23 Thread Paul Johnson
No! ?family The 'gaussian' family accepts the links 'identity', 'log' and 'inverse'; Kahra Hannu wrote: In Venables Ripley: Modern Applied Statistics with S (MASS), (4th edition), on page 184 there is a table Families and link functions that gives you the available links with

[R] Diagnosing trouble with R-2.0, Fedora Core 2, and Rcmdf

2004-10-11 Thread Paul Johnson
Greetings, R-help! On 2 Fedora Core 2 Linux systems, i've completely erased the previous R and all packages and then installed R-2.0 and installed fresh packages. In using Rcmdr, I see some trouble and I wonder if other people see this and if it is due to the tcl/tk, or R, or Rcmdr. (If

[R] polr (MASS) and lrm (Design) differences in tests of statistical signifcance

2004-09-30 Thread Paul Johnson
Greetings: I'm running R-1.9.1 on Fedora Core 2 Linux. I tested a proportional odds logistic regression with MASS's polr and Design's lrm. Parameter estimates between the 2 are consistent, but the standard errors are quite different, and the conclusions from the t and Wald tests are

[R] dotplot lattice problems: y axis values and bg color output in jpg

2004-10-22 Thread Paul Johnson
I have a linux system with Fedora Core 2 and R-2.0. I was comparing plots made with plot() and dotplot() and discovered a problem. Although the dots are positioned correctly, the numerical labels in the dotplot y axis are not correct. I put copies here:

[R] Users in Ukraine cyrillic support

2005-03-01 Thread Paul Johnson
Hello, everybody: My friends in Ukraine are starting a research lab at a national university and they asked what programs to use. I said R of course, and they then asked me 'what support does it have for Cyrillic'? i've done some snooping in the R website and all the references i find to foreign

[R] here's why it make s sense

2005-03-04 Thread Paul Johnson
if you go x[i] you are giving x an index vector, which we had mistakenly thought was an integer. Rather, it is a vector of indices for observations. Here's data x - c(1 , 4, 3, 2, 5) x[1] would be 1 x[2] would bd 4 but if you put an index vector in the brackets, you have x [ c(1,2,1,2] ] it

[R] working with pairlists imported from HDF5, converting to data frames?

2005-03-16 Thread Paul Johnson
I've used the HDF5 library to bring some data into R. THe verbose output looks like this: hdf5load(hdfGraphWed_Mar_16_13_33_37_2005.hdf,load=T,verbosity=1,tidy=T) Processing object: cprSeats .. which is a Group Processing object: Seats 0 .. its a dataset..Finished dataset

[R] lists: removing elements, iterating over elements,

2005-04-05 Thread Paul Johnson
I'm writing R code to calculate Hierarchical Social Entropy, a diversity index that Tucker Balch proposed. One article on this was published in Autonomous Robots in 2000. You can find that and others through his web page at Georgia Tech. http://www.cc.gatech.edu/~tucker/index2.html While I

[R] need automake/autoconf help to build RnetCDF and ncdf packages

2006-04-25 Thread Paul Johnson
I imagine this where are your header files problem comes up in other packages, so I'm asking this as a general R question. How should configure scripts be re-written so they look in more places? Briefly, the problem is that Fedora-Extras installs the header files in a subdirectory

[R] Making R talk to Win/OpenBUGS in Linux (again)

2006-04-29 Thread Paul Johnson
that returns information that programs can use, and I've fiddled this lots of ways, but it fails, saying Error in paste(WINEPATH, -w, x) : object WINEPATH not found library(R2WinBUGS) I hope that by giving you this small not-yet-working example, you can spot where I'm going wrong. ##Paul Johnson

Re: [R] Making R talk to Win/OpenBUGS in Linux (again)

2006-04-30 Thread Paul Johnson
(R2WinBUGS) I hope that by giving you this small not-yet-working example, you can spot where I'm going wrong. ##Paul Johnson 2006-04-29 library(R2WinBUGS) # Copied from Prof Andrew Gelman's example model.file - system.file(package = R2WinBUGS, model, schools.txt) # file.show

Re: [R] Making R talk to Win/OpenBUGS in Linux (again)

2006-05-01 Thread Paul Johnson
/06, jun yan [EMAIL PROTECTED] wrote: I have used linbugs with the rbugs package for a recent work. It might be worthwhile trying. Jun On 5/1/06, Uwe Ligges [EMAIL PROTECTED] wrote: Paul Johnson wrote: Thank you very much. With the insertion of WINEPATH declaration

Re: [R] Making R talk to Win/OpenBUGS in Linux (again)

2006-05-04 Thread Paul Johnson
, -w, x) : object WINEPATH not found library(R2WinBUGS) I hope that by giving you this small not-yet-working example, you can spot where I'm going wrong. ##Paul Johnson 2006-04-29 library(R2WinBUGS) # Copied from Prof Andrew Gelman's example model.file - system.file(package = R2WinBUGS

Re: [R] using latex() in R for Unix

2006-05-04 Thread Paul Johnson
This thread piqued my interest in how to use Hmisc latex() to produce the tables that I actually want, rather than the ones that come out by default. Actually, I'd be glad to use R2HTML or any other tool if I can make the output suit my taste. Here's a small working example that does not

Re: [R] Can't there be a cd command?

2006-05-10 Thread Paul Johnson
It is a FAQ in our Linux lab. People start emacs and fire up R via ess, and then they have no idea 'where they are. For computer experts, it is not a problem, but for people who don't know much about computers, it is a pretty big problem. They have data in some subdirectory, but almost

Re: [R] Generate object names from variables

2006-07-14 Thread Paul Johnson
I collected some advice about this question a couple of years ago. This might help. http://pj.freefaculty.org/R/Rtips.html#2.1 Add variables to a data frame (or list) and the next one after that. On 7/14/06, Marc Schwartz (via MN) [EMAIL PROTECTED] wrote: On Fri, 2006-07-14 at 16:57 +0200,

[R] Sweave: trouble controlling Design package startup output

2006-01-30 Thread Paul Johnson
Hello, everybody: I'm experimenting more with Sweave, R, and LyX. There's now an entry in the LyX wiki on using R, so anybody can do it! http://wiki.lyx.org/LyX/LyxWithRThroughSweave Now I notice this frustrating thing. I think I've done everything possible to make the Design library start up

[R] Specification decisions in glm and lmer

2006-02-28 Thread Paul Johnson
I have been reviewing GLM and LMER to sharpen up some course notes and would like to ask for your advice. 1. Is there a test that would be used to check whether a particular functional form--say Gaussian, Gamma, or Inverse Gaussian, is more appropriate in a Generalized Linear Model? A

Re: [R] predict.glm - how to?

2006-03-02 Thread Paul Johnson
On 3/2/06, Laurits Søgaard Nielsen [EMAIL PROTECTED] wrote: Hi I have a little R problem. I have created a GLM model in R and now I want to predict some values outside the values I have in the model (extrapolate). myglm - glm( some stuff here) whatever - some-new-hypothetical-data-you-create

[R] glm gives t test sometimes, z test others. Why?

2006-03-04 Thread Paul Johnson
I just ran example(glm) and happened to notice that models based on the Gamma distribution gives a t test, while the Poisson models give a z test. Why? Both are b/s.e., aren't they? I can't find documentation supporting the claim that the distribution is more like t in one case than another,

[R] how to make plotmath expression work together with paste

2006-03-05 Thread Paul Johnson
Recent questions about using plotmath have renewed my interest in this question I want to have expressions take values of variables from the environment. I am able to use expressions, and I am able to use paste to put text and values of variables into plots. But the two things just won't work

[R] Want to fit random intercept in logistic regression (testing lmer and glmmML)

2006-03-08 Thread Paul Johnson
, but the information they give on the variance components is quite different. Thanks in advance. Now I paste in the example code ### Paul Johnson [EMAIL PROTECTED] ### 2006-03-08 N - 1000 A - -1 B - 0.3 x - 1 + 10 * rnorm(N) eta - A + B * x pi - exp(eta)/(1+exp(eta)) myunif - runif(N) y

[R] Problems in package management after Linux system upgrade

2006-04-05 Thread Paul Johnson
I upgraded from Fedora Core 4 to Fedora Core 5 and I find a lot of previously installed packages won't run because shared libraries or other system things have changed out from under the installed R libraries. I do not know for sure if the R version now from Fedora-Extras (2.2.1) is exactly the

[R] Solution: Making RNetCDF work on Fedora Linux

2006-04-12 Thread Paul Johnson
Dear R users who might like to use the package RNetCDF on Fedora Linux: Fedora (versions 4 and 5) users might have noticed that the default install of the netcdf and netcdf-devel packages from the Fedora Extra archive is inconsistent with the R package RNetCDF. The attempt to install RNetCDF

[R] using betareg: problems with anova and predict

2006-04-17 Thread Paul Johnson
Dear R-helpers: We have had fun using betareg to fit models with proportions as dependent variables. However, in the analysis of these models we found some wrinkles and don't know where is the best place to start looking for a fix. The problems we see (so far) are that 1. predict ignores

Re: [R] Explaining Survival difference between Stata and R

2004-05-13 Thread Paul Johnson
Dear Goran (and others) I did not know about the eha package, but reading the docs, I see many things I've been looking for, including the parametric hazard model with Weibull baseline. Thanks for the tip, and the package. I still don't quite understand your point about the reason that coxph

[R] Explaining Survival difference between Stata and R

2004-05-10 Thread Paul Johnson
-- . last observed exit t = 7 -- Paul Johnson Dept. of Political Science University of Kansas __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide

[R] R-release.diff + R-1.9 - success on Fedora Core 2, R RPM available; ess-emacs-5.1.20 also available

2004-05-21 Thread Paul Johnson
Dear Everybody: I have Fedora Core 2 and R-1.9.0 does not build out of the box. After applying the daily patch file R-release.diff, I find it does build and I've made RPMS and SRPM. In case you want to save yourself a recompile, you can find Fedora Core RPMs in here:

[R] shared library configuration; Gnome GUI

2005-04-22 Thread Paul Johnson
Hello, everybody: On a Fedora Core 3 Linux system, I built R-2.1 using an updated version of the spec file that was used to make the RPMs for version 2.0.1 on the CRAN system. The build was fine, and packages updates perfectly. Thanks! Then I got curious about the package gnomeGUI. While

Re: [R] read SAS format file from R

2003-11-21 Thread Paul Johnson
Gabor Grothendieck wrote: kan_liu2 wrote: Can you please piont me how to read SAS format file from R (is it possible?)? There was a thread on this last month. Check out the replies to: http://maths.newcastle.edu.au/~rking/R/help/03b/5450.html

[R] packaging standards for rda files?

2003-12-11 Thread Paul Johnson
Dear everybody: We used the fine foreign library to bring in an SPSS dataset that was about 9 megabytes and I can squeeze it into a much smaller R object using compression with save(ndat, file=NatAnnES2000.rda, compress=T). I can use load() to get the ndat dataframe back, that's all good as

Re: [R] Basic question on function identical

2003-12-15 Thread Paul Johnson
I hope I am not telling you things you already know. If so, I apologize in advance. There are several C-library addons available to try to deal with the problem that comparisons of floating point numbers can be unpredictable. I think your example with the greater than sign would not be a

[R] diagnostic information in glm. How about N of missing observations?

2003-12-18 Thread Paul Johnson
I handed out some results from glm() and the students ask how many observations were dropped due to missing values? How would I know? In other stat programs, the results will typically include N and the number dropped because of missings. Without going back to R and fiddling about to find

Re: [R] R: Including R plots in a Microsoft Word document

2004-02-20 Thread Paul Johnson
I have wrestled with this problem a lot. I use Linux, coauthors use Windows, and the eps files I make from R don't work with MS Word. Well, the don't ever have previews and they sometimes won't print at all when I use CrossOver Office with MS Office 2000 in Linux. My coauthor says he can

[R] glm questions

2004-03-15 Thread Paul Johnson
Greetings, everybody. Can I ask some glm questions? 1. How do you find out -2*lnL(saturated model)? In the output from glm, I find: Null deviance: which I think is -2[lnL(null) - lnL(saturated)] Residual deviance: -2[lnL(fitted) - lnL(saturated)] The Null model is the one that includes the

Re: [R] glm questions --- saturated model

2004-03-16 Thread Paul Johnson
I'm confused going back and forth between the textbooks and these emails. Please pardon me that I seem so pedantic. I am pretty certain that -2lnL(saturated) is not 0 by definition. In the binomial model with groups of size=1, then the observed scores will be {0,1} but the predicted mean

[R] using unstack inside my function: that old scope problem again

2004-03-19 Thread Paul Johnson
I've been reading the R mail archives and I've found a lot of messages with this same kind of problem, but I can't understand the answers. Can one of you try to explain this to me? Here's my example. Given a regression model and a variable, I want to use unstack() on the vector of residuals

[R] contrast lme and glmmPQL and getting additional results...

2004-03-20 Thread Paul Johnson
I have a longitudinal data analysis project. There are 10 observations on each of 15 units, and I'm estimating this with randomly varying intercepts along with an AR1 correction for the error terms within units. There is no correlation across units. Blundering around in R for a long time, I

[R] solved mystery of difference between glmmPQL and lme

2004-03-22 Thread Paul Johnson
I asked a few days ago about the difference in results I saw between the MASS function glmmPQL (due to Venables and Ripley) and the lme function from the package nlme (due to Pinheiro and Bates). When the two tools apply to the same model (gaussian, link=identity, correlation=AR1), I was

Re: [R] One inflated Poisson or Negative Binomal regression

2004-04-19 Thread Paul Johnson
Dear Peter: I notice there is a R code for a Zero-inflated Poisson/NB process on the Stanford Political Science Computational Lab (Prof. Simon Jackman) web page. If I were wanting to do a one-inflated model, I would start with that because, at least to my eye, it is very easy to follow.

[R] Need advice about models with ordinal input variables

2005-11-08 Thread Paul Johnson
Dear colleagues: I've been storing up this question for a long time and apologize for the length and verbosity of it. I am having trouble in consulting with graduate students on their research projects. They are using surveys to investigate the sources of voter behavior or attitudes. They

[R] Predicting and Plotting hypothetical values of factors

2005-11-17 Thread Paul Johnson
. Are there simpler, less frustrating approaches? - # Paul Johnson pauljohn at ku.edu 2005-11-17 # factorFutzing-1.R myfac - factor(c(1.1, 4.5, 1.1, 1.1, 4.5, 1.1, 4.5, 1.1)) y - c(0,1,0,1,0,0,1,0) mymod1 -glm (y~myfac, family=binomial) p1 - predict(mymod1, type

Re: [R] Hmisc latex function

2005-12-15 Thread Paul Johnson
Does anybody suggest a work-around this problem? pj Marc Schwartz (via MN) wrote: On Wed, 2005-10-12 at 08:33 -0500, Charles Dupont wrote: Marc Schwartz (via MN) wrote: On Tue, 2005-10-11 at 10:01 -0400, Rick Bilonick wrote: I'm using R 2.2.0 on an up-to-date version of Fedora Core 4 with

Re: [R] multiple lowess line in one plot

2006-01-04 Thread Paul Johnson
It appears to me lowess has no subset or strata option. The brute-force way (which my students like best) is just to create 4 columns, one for each group (with unstack or such) and then run one lines(lowess()) command for each one. I think there is a bit more art in using by, which will create

[R] Current state of support for BUGS access for Linux users?

2006-01-16 Thread Paul Johnson
Greetings: I'm going to encourage some students to try Bayesian ideas for hierarchical models. I want to run the WinBUGS and R examples in Tony Lancaster's An Introduction to Modern Bayesian Econometrics. That features MS Windows and bugs from R2WinBUGS. Today, I want to ask how people are

Re: [R] Current state of support for BUGS access for Linux users?

2006-01-17 Thread Paul Johnson
. On 1/17/06, Uwe Ligges [EMAIL PROTECTED] wrote: Paul Johnson wrote: Greetings: I'm going to encourage some students to try Bayesian ideas for hierarchical models. I want to run the WinBUGS and R examples in Tony Lancaster's An Introduction to Modern Bayesian Econometrics. That features

Re: [R] Current state of support for BUGS access for Linux users?

2006-01-17 Thread Paul Johnson
ever appears in the log file and there are no computations going on (according to system monitors, anyway), but everything in OpenBUGS just seems stuck. pj On 1/17/06, Uwe Ligges [EMAIL PROTECTED] wrote: Paul Johnson wrote: Thanks, Uwe that clears up why I can't make R2WinBUGs work

Re: [R] Current state of support for BUGS access for Linux users?

2006-01-17 Thread Paul Johnson
Before I forget, found the working recipe for rbugs. My mistake before was not realzing that the n.iter value is total iterations, including burnin, and so by setting n.iter=1000 and n.burnin=1000, I was leaving 0 iterations for the updates. ### Paul Johnson 2006-01-18. This does work! ### Works

[R] cron job install/update problems: tcltk can't find display (installing e.g., pbatR)

2006-01-20 Thread Paul Johnson
' ** Restoring previous '/usr/lib/R/library/pbatR' -- Here's the R code that runs from the Cron job # Paul Johnson [EMAIL PROTECTED] 2005-08-31 # This should update and then install all packages, except for # ones I exclude because they don't

[R] Segmentation fault/buffer overflow with fix() in Fedora Core 5 from Extras repository

2006-10-19 Thread Paul Johnson
The Fedora Extras update of R found its way onto my systems today and I noted that fix() and edit() no longer work. There is a program crash that closes up R, but it does not leave a core file. I've tested by turning off SELinux, it had no effect. Do you see it too? What do you think? It

[R] ordered logistic regression with random effects. Howto?

2007-05-07 Thread Paul Johnson
I'd like to estimate an ordinal logistic regression with a random effect for a grouping variable. I do not find a pre-packaged algorithm for this. I've found methods glmmML (package: glmmML) and lmer (package: lme4) both work fine with dichotomous dependent variables. I'd like a model similar

[R] Follow-up about ordinal logit with mixtures: how about 'continuation ratio' strategy?

2007-05-09 Thread Paul Johnson
This is a follow up to the message I posted 3 days ago about how to estimate mixed ordinal logit models. I hope you don't mind that I am just pasting in the code and comments from an R file for your feedback. Actual estimates are at the end of the post. ### Subject: mixed ordinal logit via

Re: [R] Follow-up about ordinal logit with mixtures: how about 'continuation ratio' strategy?

2007-05-11 Thread Paul Johnson
On 5/10/07, Frank E Harrell Jr [EMAIL PROTECTED] wrote: Paul Johnson wrote: This is a follow up to the message I posted 3 days ago about how to estimate mixed ordinal logit models. I hope you don't mind that I am just pasting in the code and comments from an R file for your feedback

[R] Can I access the filename of the active editor window?

2007-06-11 Thread Paul Johnson
When I run a script from an open editor window (using Ctrl-A, Ctrl-R), I would like the filename of the script to be automatically written into the program output, to keep up with frequent version changes. Is there a way to access the filename (+ path) of the open script (the active one, if there

[R] random effects in logistic regression (lmer)-- identification question

2007-06-14 Thread Paul Johnson
Hello R users! I've been experimenting with lmer to estimate a mixed model with a dichotomous dependent variable. The goal is to fit a hierarchical model in which we compare the effect of individual and city-level variables. I've run up against a conceptual problem that I expect one of you can