Re: [R] grep

2024-07-12 Thread Steven Yen
Now I've found another way to make it work. All I need is to pick up the names in the column (x.1.age...). > v<-pr(goprobit.p); v Maximum-Likelihood Estimates weighted = FALSE iterations = 5 logLik = -14160.75 finalHessian = TRUE Covariance matrix is Robust Number of parameters = 66 Sample siz

Re: [R] grep

2024-07-12 Thread Rui Barradas
Hello,l Though the question is already answered, here is another answer to what is 'x'. The output in the OP is not a lm or glm output but if your regression model was programmed according to recommended practices, there must be a 'coefficients' member in the list or object it returns and th

Re: [R] grep

2024-07-12 Thread Jorgen Harmse via R-help
which(grepl()) looks odd. Doesn't grep by itself return the correct vector of indices? Regards, Jorgen Harmse. Message: 5 Date: Fri, 12 Jul 2024 17:42:05 +0800 From: Steven Yen mailto:st...@ntu.edu.tw>> To: Uwe Ligges mailto:lig...@statistik.tu-dortmund.de>>, R-help Mailing List mailto:r-h

Re: [R] grep

2024-07-12 Thread Steven Yen
Sorry. grepl worked: which(grepl("very|somewhat",names(goprobit.p$est))) On 7/12/2024 5:34 PM, Steven Yen wrote: > > Could not get "which" to work, but my grep worked. Thanks. > > > which(grep("very|somewhat",names(goprobit.p$est))) Error in > which(grep("very|somewhat", names(goprobit.p$est)))

Re: [R] grep

2024-07-12 Thread Steven Yen
Could not get "which" to work, but my grep worked. Thanks. > which(grep("very|somewhat",names(goprobit.p$est))) Error in which(grep("very|somewhat", names(goprobit.p$est))) : argument to 'which' is not logical > grep("very|somewhat",names(goprobit.p$est)) [1] 6 7 8 9 10 11 12 13 28 29 30 31 32

Re: [R] grep

2024-07-12 Thread Steven Yen
Thanks. In this case below, what is "x"? I tried rownames(out) which did not work. Sorry. Does this sound like homework to you? On 7/12/2024 5:09 PM, Uwe Ligges wrote: On 12.07.2024 10:54, Steven Yen wrote: Below is part a regression printout. How can I use "grep" to identify rows headed by

Re: [R] grep

2024-07-12 Thread Uwe Ligges
On 12.07.2024 10:54, Steven Yen wrote: Below is part a regression printout. How can I use "grep" to identify rows headed by variables (first column) with a certain label. In this case, I like to find variables containing "somewhath", "veryh", "somewhatm", "verym", "somewhatc", "veryc","somewhat

[R] grep

2024-07-12 Thread Steven Yen
Below is part a regression printout. How can I use "grep" to identify rows headed by variables (first column) with a certain label. In this case, I like to find variables containing "somewhath", "veryh", "somewhatm", "verym", "somewhatc", "veryc","somewhatl", "veryl". The result should be an in