Re: [R] seeking help with splicing in R

2024-04-11 Thread Ebert,Timothy Aaron
flation to "convert" base years? Tim -Original Message- From: R-help On Behalf Of Manya Budhiraja Sent: Wednesday, April 10, 2024 3:16 PM To: r-help@r-project.org Subject: [R] seeking help with splicing in R [External Email] Hello! I was trying to splice two wholesale price in

[R] seeking help with splicing in R

2024-04-11 Thread Manya Budhiraja
Hello! I was trying to splice two wholesale price index deflators series which have different base years. One of them is called wpi_def_nic2004(from 2005 to 2012), and another is called wpi_def_nic2008(from 2012 to 2019). I am trying to create a single series such that the base year prices are con

Re: [R] Seeking help for using optim for MLE in R

2019-01-10 Thread Bert Gunter
Probably: don't do this. Use the nnet package (and there may well be others) to fit multinomial regression. See here for a tutorial: https://rpubs.com/rslbliss/r_logistic_ws Cheers, Bert On Thu, Jan 10, 2019 at 6:18 AM Naznin Sultana wrote: > Hi, I am writing a program for MLE of parameters

[R] Seeking help for using optim for MLE in R

2019-01-10 Thread Naznin Sultana
Hi, I am writing a program for MLE of parameters of multinomial distribution using optim.But when I run the program outside of a function it gives me the likelihood value, but when using it for optim function it gives the error message "Error in X %*% beta : non-conformable arguments". If X, and be

Re: [R] Seeking help with code

2017-12-07 Thread David Winsemius
> On Dec 7, 2017, at 2:51 PM, Stephanie Tsalwa wrote: > > Assuming the days of raining during half a year of all states(provinces) of a > country is normally distributed (mean=�, standard deviation=�) with sigma (�) > equals to 2. We now have 10 data points here: 26.64, 30.65, 31.27, 33.04, >

Re: [R] Seeking help

2015-09-09 Thread Duncan Murdoch
On 09/09/2015 8:11 AM, varun yadav wrote: Hi, I am working on Predictive analytics assignment This list isn't for help with homework. You should ask your instructor for help. Duncan Murdoch __ R-help@r-project.org mailing list -- To UNSUBSCRIBE

[R] Seeking help

2015-09-09 Thread varun yadav
Hi, I am working on Predictive analytics assignment i which i need to predict winner of state election . Data set is not very big but have multiple files and as per my understanding only few of them are useful. Problem statement is "* Which party should be given chance by the people to rule Bihar

Re: [R] Seeking help with LOGIT model

2012-04-12 Thread Ken Knoblauch
You should look up the Hauck-Donne phenomenon, which shows that with binomial GLMs, the standard error can grow faster than the effect size. Complete separation results, for example, when one predictor (or a combination of several predictors) perfectly predicts the response. Something like this

Re: [R] Seeking help with LOGIT model

2012-04-12 Thread Christofer Bogaso
Thanks Ken for your reply. No doubt your english is quite tough!! I understand something is not normal with the 5th explanatory variable (se:2872.17069!) However could not understand what you mean by "You seem to be getting complete separation on X5 "? Can you please be more elaborate? Thanks, O

Re: [R] Seeking help with LOGIT model

2012-04-12 Thread ken knoblauch
Christofer Bogaso gmail.com> writes: > Dear all, I am fitting a LOGIT model on this Data... << snip >>--- > glm(Data[,1] ~ Data[,-1], binomial(link = logit)) > > Call: glm(formula = Data[, 1] ~ Data[, -1], family = binomial(link = logit)) > > Coefficients: > (Intercept) Data[, -

[R] Seeking help with LOGIT model

2012-04-12 Thread Christofer Bogaso
Dear all, I am fitting a LOGIT model on this Data... Data <- structure(c(1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 0, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 0, 1, 1, 0, 1, 0, 47, 58, 82, 100, 222, 164, 161, 70, 219, 81, 209, 182, 185, 104, 126, 192, 95, 245, 9

Re: [R] Seeking help on permutation

2011-07-22 Thread Joshua Wiley
Hi, Look at ?combn t(combn(Vector, 2)) gives: [,1] [,2] [1,] "a" "b" [2,] "a" "c" [3,] "b" "c" No idea how it is speed-wise. HTH, Josh On Fri, Jul 22, 2011 at 10:09 AM, Megh Dal wrote: > Let say, I have a character vector of arbitrary length: > > Vector <- c("a", "b", "c") > > Usin

[R] Seeking help on permutation

2011-07-22 Thread Megh Dal
Let say, I have a character vector of arbitrary length: Vector <- c("a", "b", "c") Using that vector I would like to create a matrix (with number of columns as 2) with all pairwise combinations of those elements, like: Vector <- c("a", "b", "c") Mat     <- rbind(c("a", "b"), c("a", "c"), c("b",

Re: [R] Seeking help to define method for show() for an S4 object

2011-06-06 Thread Joshua Wiley
Hi, Take a look at ?readLines Also, you should use function(object) not function(x) because of how the generic is defined. Below is an example. Cheers, Josh setClass("MyClass", sealed = FALSE, representation( Slot1 = "vector", Slot2 = "vector")) setMethod(f = "show", signature = "MyClass

[R] Seeking help to define method for show() for an S4 object

2011-06-06 Thread Bogaso Christofer
Dear all, I have created a new S4 class with name "MyClass". Please see below for it's definition. Now I want to create a method for the show() function for this class. In defining this method, what I want is, once user would like see an object of this class some values will be displayed. Then R wi

Re: [R] seeking help on using LARS package

2011-05-24 Thread Steve Lianoglou
Hi, On Tue, May 24, 2011 at 12:50 PM, Vishal Thapar wrote: > Hi, > > I am writing to seek some guidance regarding using Lasso regression with the > R package LARS. I have introductory statistics background but I am trying to > learn more. Right now I am trying to duplicate the results in a paper

[R] seeking help on using LARS package

2011-05-24 Thread Vishal Thapar
Hi, I am writing to seek some guidance regarding using Lasso regression with the R package LARS. I have introductory statistics background but I am trying to learn more. Right now I am trying to duplicate the results in a paper for shRNA prediction "An accurate and interpretable model for siRNA ef

Re: [R] Seeking help re: ? single apply command or an alternative

2011-04-21 Thread Niels Richard Hansen
a1 * a3[a2] - Niels Dear R-help list, Sorry to trouble everyone. This seems like it could be achieved with a single command (? variant of apply), but I am not quite seeing it. I am trying to multiply one vector (a1 below) by corresponding values in a3 (as determined by matching element in a v

[R] Seeking help re: ? single apply command or an alternative

2011-04-21 Thread Min-Han Tan
Dear R-help list, Sorry to trouble everyone. This seems like it could be achieved with a single command (? variant of apply), but I am not quite seeing it. I am trying to multiply one vector (a1 below) by corresponding values in a3 (as determined by matching element in a vector a2). The example b

Re: [R] Seeking help in Package development

2011-02-20 Thread Mike Marchywka
> Date: Sun, 20 Feb 2011 15:56:41 +0100 > From: lig...@statistik.tu-dortmund.de > To: jwiley.ps...@gmail.com > CC: r-help@r-project.org > Subject: Re: [R] Seeking help in Package development > > May I add that the best docum

Re: [R] Seeking help in Package development

2011-02-20 Thread Uwe Ligges
May I add that the best documentation for building packages is the "Writing R Extensions" that ships with the current R version. It is always current, precise, and not as outdated as many resources you find "somewhere" in the web - yes, the one cited below is outdated. Uwe Ligges On 19.02.20

Re: [R] Seeking help in Package development

2011-02-19 Thread Joshua Wiley
Hi Nipesh, Although "c:/Program Files/R/R-2.12.1/bin/" may be where R.exe is located, it is not where you want to locate your package, and, as Gabor pointed out, it is best to keep your package outside of the main R tree. Your package does not need to be in the same location as R.exe, you just ne

Re: [R] Seeking help in Package development

2011-02-19 Thread Gabor Grothendieck
On Sat, Feb 19, 2011 at 6:19 PM, Nipesh Bajaj wrote: > Hi Gabor, can you be more detail on step 01? Is that not the correct > path for R.exe? But I found it there. > > When I ran R CMD build MyPackage then actually got these warnings: > cygwin warnings: > MS-DOS style path detected: c:/Program Fil

Re: [R] Seeking help in Package development

2011-02-19 Thread Nipesh Bajaj
Hi Gabor, can you be more detail on step 01? Is that not the correct path for R.exe? But I found it there. When I ran R CMD build MyPackage then actually got these warnings: cygwin warnings: MS-DOS style path detected: c:/Program Files/R/R-2.12.1/bin/Mypackage_1.0.tar prefered POSIX equivalent is

Re: [R] Seeking help in Package development

2011-02-19 Thread Gabor Grothendieck
On Sat, Feb 19, 2011 at 5:31 PM, Nipesh Bajaj wrote: > Thanks Gabor for your input. Here what I have done is that: > > 1. Copy 'MyPackage' folder (developed by package.skeleton) into > 'C:\Program Files\R\R-2.12.1\bin' (I found R.exe is there) > > 2. In the command prompt, I changed the working di

Re: [R] Seeking help in Package development

2011-02-19 Thread Nipesh Bajaj
Thanks Gabor for your input. Here what I have done is that: 1. Copy 'MyPackage' folder (developed by package.skeleton) into 'C:\Program Files\R\R-2.12.1\bin' (I found R.exe is there) 2. In the command prompt, I changed the working directory using "CD" command and run 'R CMD build MyPackage' 3. I

Re: [R] Seeking help in Package development

2011-02-19 Thread Joshua Wiley
Dear Nipesh, On Sat, Feb 19, 2011 at 1:39 PM, Nipesh Bajaj wrote: > Dear all, I am a new user of R and currently trying hard to develop my > own package. Here I am following this tutorial > 'http://www.mathfinance.cn/how-to-create-an-R-package-in-windows/' > > Here it says that (step 8): "open a

Re: [R] Seeking help in Package development

2011-02-19 Thread Gabor Grothendieck
On Sat, Feb 19, 2011 at 4:39 PM, Nipesh Bajaj wrote: > Dear all, I am a new user of R and currently trying hard to develop my > own package. Here I am following this tutorial > 'http://www.mathfinance.cn/how-to-create-an-R-package-in-windows/' > > Here it says that (step 8): "open a “command promp

[R] Seeking help in Package development

2011-02-19 Thread Nipesh Bajaj
Dear all, I am a new user of R and currently trying hard to develop my own package. Here I am following this tutorial 'http://www.mathfinance.cn/how-to-create-an-R-package-in-windows/' Here it says that (step 8): "open a “command prompt” window, change the directory to where your package is, type

Re: [R] Seeking help to define s4 method for 'print'

2011-02-07 Thread Joshua Wiley
Hi Christofer, I think this might not be the best use of S4 methods (I am still at the constantly rereading the R extensions manual and John Chambers' book stage), but since you are just printing numeric class data, I would be tempted to use set it up so your method just passes it on to the defaul

[R] Seeking help to define s4 method for 'print'

2011-02-07 Thread Bogaso Christofer
I have got another question on defining a method for print() function for my s4 class. Here is my class definition as well as what I have done till now: > setClass("Me", representation(x1 = "numeric", x2 = "numeric", y1 = "character")) [1] "Me" > setMethod("print", "Me", definition=function(x

Re: [R] Seeking help to define method for '+'

2011-02-05 Thread Martin Morgan
eric(e1@x1, e2@x2) x2=c(e1@x2, e2@x2)) }) i.e., return an instance of "Me". Martin > > What can I do to handle this? > > Thanks and regards, > > > -Original Message- > From: Martin Morgan [mailto:mtmor...@fhcrc.org] > Sent: 06 Februar

Re: [R] Seeking help to define method for '+'

2011-02-05 Thread Duncan Murdoch
h Thanks and regards, -Original Message- From: Martin Morgan [mailto:mtmor...@fhcrc.org] Sent: 06 February 2011 03:57 To: Bogaso Christofer Cc: r-help@r-project.org Subject: Re: [R] Seeking help to define method for '+' On 02/05/2011 02:19 PM, Bogaso Christofer wrote: Dear

Re: [R] Seeking help to define method for '+'

2011-02-05 Thread Bogaso Christofer
Sent: 06 February 2011 03:57 To: Bogaso Christofer Cc: r-help@r-project.org Subject: Re: [R] Seeking help to define method for '+' On 02/05/2011 02:19 PM, Bogaso Christofer wrote: > Dear all, I am trying to define "+" method for my newly defined s4 class > which is as fol

Re: [R] Seeking help to define method for '+'

2011-02-05 Thread Martin Morgan
On 02/05/2011 02:19 PM, Bogaso Christofer wrote: > Dear all, I am trying to define "+" method for my newly defined s4 class > which is as follows: > > > > setClass("Me", sealed=F,representation(x1 = "numeric", x2 = "character")) > > new1 <- new("Me", x1=2, x2="comment1") > > new2 <- new("Me",

[R] Seeking help to define method for '+'

2011-02-05 Thread Bogaso Christofer
Dear all, I am trying to define "+" method for my newly defined s4 class which is as follows: setClass("Me", sealed=F,representation(x1 = "numeric", x2 = "character")) new1 <- new("Me", x1=2, x2="comment1") new2 <- new("Me", x1=3, x2="comment1") setMethod("+", "Me", definition=function(x,

Re: [R] Seeking help on Vectorize()

2010-06-03 Thread Duncan Murdoch
Megh Dal wrote: Dear falks, here I have written following function : fn <- Vectorize(function(x = 1:3, y = 3:6) { x <- matrix(x, nrow=1) y <- matrix(y, ncol=1) dat <- apply(x, 2, function(xx) { apply(y, 1, function(yy) {

Re: [R] Seeking help on Vectorize()

2010-06-02 Thread Dennis Murphy
Hi: This is shorter: t(outer(x, y, '+')) [,1] [,2] [,3] [1,]456 [2,]567 [3,]678 [4,]789 [5,]89 10 HTH, Dennis On Wed, Jun 2, 2010 at 2:25 AM, Megh Dal wrote: > Dear falks, here I have written following function : > > fn <- Vectori

Re: [R] Seeking help on Vectorize()

2010-06-02 Thread Joris Meys
Your arguments are not coming through. fn <- function(x = 1:3, y = 3:6) { x <- matrix(x, nrow=1) y <- matrix(y, ncol=1) dat <- apply(x, 2, function(xx) { apply(y, 1, function(yy) { return(xx + yy) } ) })

[R] Seeking help on Vectorize()

2010-06-02 Thread Megh Dal
Dear falks, here I have written following function :   fn <- Vectorize(function(x = 1:3, y = 3:6) {     x <- matrix(x, nrow=1)     y <- matrix(y, ncol=1)     dat <- apply(x, 2, function(xx) {   apply(y, 1, function(yy) {   retu

Re: [R] Seeking help with trellis: log scales on xyplot

2008-05-23 Thread Deepayan Sarkar
On 5/23/08, hobie perry <[EMAIL PROTECTED]> wrote: > > Good afternoon. > > The basic plot function can automatically generate log scales as follows: > > plot(calcium ~ soil_ph, log="y") > > Here is my basic model in xyplot... > > xyplot(calcium+magnesium ~ soil_ph|depth*region) > > I

[R] Seeking help with trellis: log scales on xyplot

2008-05-23 Thread hobie perry
Good afternoon. The basic plot function can automatically generate log scales as follows: plot(calcium ~ soil_ph, log="y") Here is my basic model in xyplot... xyplot(calcium+magnesium ~ soil_ph|depth*region) I would like the calcium and magnesium values to be reported on a log scale