Re: [R] Best Optimization Routines

2018-02-15 Thread Paul Smith
On Tue, Feb 13, 2018 at 7:55 PM, JamesRyan(Ryan James)/E&P North America Business Division wrote: > I have a set of data, the production of oil from a well. And an equation to > predict that forecast. > > The equation requires 5 input variables which are real numbers with upper and > lower boun

Re: [R] Most appropriate function for the following optimisation issue?

2015-10-20 Thread Paul Smith
On Tue, Oct 20, 2015 at 11:58 AM, Andy Yuan wrote: > > Please could you help me to select the most appropriate/fastest function to > use for the following constraint optimisation issue? > > Objective function: > > Min: Sum( (X[i] - S[i] )^2) > > Subject to constraint : > > Sum (B[i] x X[i]) =0 >

Re: [R] drawing segments through points with pch=1

2008-07-20 Thread Paul Smith
On Sun, Jul 20, 2008 at 1:44 PM, David Epstein <[EMAIL PROTECTED]> wrote: > Please excuse me for asking such basic questions: > > Here is my code >> >> y=c(1.21,0.51,0.14,1.62,-0.8,0.72,-1.71,0.84,0.02,-0.12) >> ybar=mean(y) >> ll=length(y); >> ybarv=rep(ybar,ll) >> x=1:ll >> plot(x,ybarv,pch=1) >>

Re: [R] asp and ylim

2008-07-20 Thread Paul Smith
On Sun, Jul 20, 2008 at 11:14 PM, Gabor Grothendieck <[EMAIL PROTECTED]> wrote: > Try lattice: > > library(lattice) > xyplot(y ~ x, ylim = c(0.5, 0.7), aspect = "iso") Alternatively, set.seed(42) x <- runif(10) y <- runif(10) plot(x[(y>=0.5) & (y<=0.7)],y[(y>=0.5) & (y<=0.7)],ylim=c(0.5,0.7),asp=

Re: [R] Accessing individual variables from summary of lm

2008-07-22 Thread Paul Smith
On Tue, Jul 22, 2008 at 5:44 AM, ascentnet <[EMAIL PROTECTED]> wrote: > I am trying to access the R2, intercept, and slope out of the summary from an > lm so that I can insert it into a database using RODBC. How can I access > these individually? Try: data(swiss) model <- lm(Infant.Mortality ~ .

Re: [R] Rcommander installation fails on Fedora 9

2008-08-15 Thread Paul Smith
On Fri, Aug 15, 2008 at 6:15 PM, John Sorkin <[EMAIL PROTECTED]> wrote: > Fedora 9 > R 2.7.1 > > I tried to install R on my Linux system using > install.packages("Rcmdr", dependencies=TRUE). > > I received many, many, many error messages. I hope someone can suggest a > fix. > > The output from warn

Re: [R] Rcommander installation fails on Fedora 9

2008-08-15 Thread Paul Smith
gfortran -lm -L/usr/lib/R/lib > -lR > > > > > > > Thanks, > John > > John Sorkin M.D., Ph.D. > Chief, Biostatistics and Informatics > Baltimore VA Medical Center GRECC, > University of Maryland School of Medicine Claude D. Pepper OAIC, > University of Ma

Re: [R] nonlinear constrained optimization

2008-08-19 Thread Paul Smith
On Tue, Aug 19, 2008 at 8:35 AM, Chua Siang Li <[EMAIL PROTECTED]> wrote: > > Hi. I need some advises on how to use R to find pi (i is the index) with > the following objective function and constraint: > > max (sum i)[ f(ai, bi, pi) * g(ci, di, pi) * Di ] > > s.t. (sum i)[ f(ai, bi, pi) *

Re: [R] nonlinear constrained optimization

2008-08-20 Thread Paul Smith
On Tue, Aug 19, 2008 at 7:37 PM, Ravi Varadhan <[EMAIL PROTECTED]> wrote: > The "Tango project" website (from Brazil) has some R functions to implement > Algencan. I haven't used it, but I would be interested to hear others' > experience if someone has already used it or will be using it. Ravi,

Re: [R] nonlinear constrained optimization

2008-08-20 Thread Paul Smith
On Tue, Aug 19, 2008 at 8:12 PM, Hans W. Borchers <[EMAIL PROTECTED]> wrote: > Please have a look at the 'Rdonlp2' package at . > It provides non-linear optimization with nonlinear constraints. Notwithstanding, be aware of the following limitation of Donlp2: "If the pr

[R] Appending strings at the beginning of a text file

2009-08-25 Thread Paul Smith
Dear All, I have a piece of text that I want to append to a text file at the beginning of the text file. I have thought about using cat() with the option 'append=T', but the appending, in this case, is done at the bottom of the text file. Any ideas? Thanks in advance, Paul

Re: [R] Appending strings at the beginning of a text file

2009-08-25 Thread Paul Smith
M, Henrique Dallazuanna wrote: > Try this; > > fConn <- file('test.txt', 'r+') > Lines <- readLines(fConn) > writeLines(paste("Text at beginning of file", Lines, sep = "\n"), >    con = fConn) > > On Tue, Aug 25, 2009 at

Re: [R] Appending strings at the beginning of a text file

2009-08-26 Thread Paul Smith
he writeLines. > > On Tue, Aug 25, 2009 at 2:48 PM, Paul Smith wrote: >> >> Thanks, Henrique. >> >> I think you mean the following: >> >> fConn <- file('test.txt', 'r+') >> Lines <- readLines(fConn) >> writeLines(c(&qu

[R] Looking for Rdonlp2

2009-06-27 Thread Paul Smith
Dear All, I tried to download the package Rdonlp2 from the address given at "CRAN Task View: Optimization and Mathematical Programming": http://arumat.net/Rdonlp2/ However, this link seems to be dead. Any ideas? Thanks in advance, Paul __ R-help@r-p

Re: [R] Looking for Rdonlp2

2009-06-27 Thread Paul Smith
Thanks, Mario. With a different browser, it works, but not with Firefox 3.5b4. Paul On Sat, Jun 27, 2009 at 7:19 PM, Mario Valle wrote: > Retry, it works for me. > Ciao! >               mario > > Paul Smith wrote: >> >> Dear All, >> >> I tried to downlo

Re: [R] minimization function

2010-04-10 Thread Paul Smith
On Sat, Apr 10, 2010 at 4:58 PM, li li wrote: >    I am trying to minimize the quardratic form w'Aw, with certain > constraints. > In particular, >    (1) A=(a_{ij}) is n by n matrix and it is symmetric positive definite, >        a_{ii}=1 for all i; >        and 0    (2) w'1=n; >    (3) w_{i}>=0

Re: [R] minimization function

2010-04-10 Thread Paul Smith
On Sat, Apr 10, 2010 at 5:13 PM, Paul Smith wrote: >>    I am trying to minimize the quardratic form w'Aw, with certain >> constraints. >> In particular, >>    (1) A=(a_{ij}) is n by n matrix and it is symmetric positive definite, >>        a_{ii}=1 for a

[R] Problem with downloading workspace file from a web address

2009-09-26 Thread Paul Smith
Dear All, To load a previously saved workspace, one can do the following: load("/path/to/the/saved/workspace/file") However, if the path to the saved workspace file is a web address, one gets the following error: «Error in readChar(con, 5L, useBytes = TRUE) : cannot open the connection In addit

Re: [R] Problem with downloading workspace file from a web address

2009-09-27 Thread Paul Smith
2009/9/27 Uwe Ligges : >> To load a previously saved workspace, one can do the following: >> >> load("/path/to/the/saved/workspace/file") >> >> However, if the path to the saved workspace file is a web address, one >> gets the following error: >> >> «Error in readChar(con, 5L, useBytes = TRUE) : ca

[R] Boxplot with grouped data

2009-10-22 Thread Paul Smith
Dear All, Is there some way of drawing a boxplot, with R, when one does not have the original continuous data, but only the data grouped in classes? The function boxplot() can only deal with original data. Thanks in advance, Paul __ R-help@r-project.o

Re: [R] Boxplot with grouped data

2009-10-22 Thread Paul Smith
On Thu, Oct 22, 2009 at 5:31 PM, Jakson A. Aquino wrote: >> Is there some way of drawing a boxplot, with R, when one does not have >> the original continuous data, but only the data grouped in classes? >> The function boxplot() can only deal with original data. > > Do you mean a numeric vector gro

Re: [R] Playing with rgl: a Youtube video

2009-12-21 Thread Paul Smith
On Mon, Dec 21, 2009 at 12:42 PM, Duncan Murdoch wrote: > I've just posted a demo made with the rgl package to Youtube, visible here: >  http://www.youtube.com/watch?v=prdZWQD7L5c > > For future reference, here are the steps I used: > > 1.  Design a shape to be displayed, and then play with the an

[R] From two colors to 01 sequences

2009-05-12 Thread Paul Smith
Dear All, Perhaps, what I am asking is impossible, but I am asking it anyway. I have got several pdf files with rows of colored rectangles: red rectangles should be read as 0; green rectangles as 1. No other color exists. Is there some way to have R reading the colored rectangles to a matrix or d

Re: [R] From two colors to 01 sequences

2009-05-12 Thread Paul Smith
Thanks, Baptiste and Zeljko. I am attaching here an example of the picture of the rectangles. Paul On Tue, May 12, 2009 at 1:23 PM, baptiste auguie wrote: > > Depending on the nature of your pdf file, it may be possible to use > the grImport package. I've never used it before, but a quick test

Re: [R] Fwd: From two colors to 01 sequences

2009-05-12 Thread Paul Smith
On Tue, May 12, 2009 at 2:35 PM, Zeljko Vrba wrote: > Aha, so you DON'T have only red and green rectangles in the picture, there is > also white in between, and some pale delimiter lines.  Nevertheless, both > things ease the job slightly, and the approach I described should work.  You > can even

Re: [R] Optimization Question

2009-06-12 Thread Paul Smith
On Thu, Jun 11, 2009 at 9:56 PM, Brecknock, Peter wrote: > Apologies if this is not the correct list for this question. > > The Rglpk package offers the following example in its documentation > > library(Rglpk) > ## Simple mixed integer linear program. > ## maximize: 3 x_1 + 1 x_2 + 3 x_3 > ## subj

Re: [R] Constrined dependent optimization.

2009-03-30 Thread Paul Smith
On Sun, Mar 29, 2009 at 9:45 PM, wrote: > I have an optimization question that I was hoping to get some suggestions on > how best to go about sovling it. I would think there is probably a package > that addresses this problem. > > This is an ordering optimzation problem. Best to describe it wit

Re: [R] Constrined dependent optimization.

2009-03-30 Thread Paul Smith
or the suggestions. > > Kevin > > Paul Smith wrote: >> On Sun, Mar 29, 2009 at 9:45 PM,   wrote: >> > I have an optimization question that I was hoping to get some suggestions >> > on how best to go about sovling it. I would think there is probably a >>

Re: [R] Constrined dependent optimization.

2009-03-30 Thread Paul Smith
ram > here such as the free software Bprolog. I would be interested to > learn what others propose. > > Of course, if we don't know anything about the function f then > it amounts to an exhaustive search on the 100! permutations -- > probably not a feasible job. > > Regards,  

Re: [R] Constrined dependent optimization.

2009-03-30 Thread Paul Smith
to an exhaustive search on the 100! permutations -- > probably not a feasible job. > > Regards,  Hans Werner > > > > Paul Smith wrote: >> >> On Sun, Mar 29, 2009 at 9:45 PM,   wrote: >>> I have an optimization question that I was hoping to get some sug

Re: [R] Constrined dependent optimization.

2009-03-30 Thread Paul Smith
tions, one gets the exact optimal solution, which does not take too long. Paul On Mon, Mar 30, 2009 at 5:11 PM, Paul Smith wrote: > Optim with SANN also solves your example: > > --- > > f <- function(x) sum(c(1:50,50:1)*x) > >

Re: [R] Constrined dependent optimization.

2009-04-02 Thread Paul Smith
SANN. Does your answer > change if instead of 100 "variables" or bins there are 20,000? From the > documentation L-BFGS-B is designed for a large number of variables. But maybe > SANN can handle this as well. > > Kevin > > Paul Smith wrote: >> Apparently

Re: [R] Constrined dependent optimization.

2009-04-02 Thread Paul Smith
On Thu, Apr 2, 2009 at 3:49 PM, wrote: > Sorry I sent a description of the function I was trying to minimize but I > must not have sent it to this group (and you). Hopefully with this clearer > description of my problem you might have some suggestions. > > It is basically a warehouse placement

[R] Code of sample() in C

2009-04-05 Thread Paul Smith
Dear All, I would like to use the function sample() in a program written in C. Is there somewhere the code of sample() written in C? Thanks in advance, Paul __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do re

Re: [R] Code of sample() in C

2009-04-05 Thread Paul Smith
t wishes, > Ranjan > > On Sun, 5 Apr 2009 15:35:25 +0100 Paul Smith wrote: > >> Dear All, >> >> I would like to use the function sample() in a program written in C. >> Is there somewhere the code of sample() written in C? >> >> Thanks in advance, >>

Re: [R] Code of sample() in C

2009-04-06 Thread Paul Smith
t;    const double len = (double) n; >    int i; >    int* x = malloc(n * sizeof(int)); >    if (!x) { >      return 2; >    } > >    for (i = 0; i < n; ++i)     x[i] = i; > >    for (i = 0; i < k; ++i) { >      const int j = (int)(len * runif(0.0, 1.0)); >      y[i] = x[

Re: [R] Code of sample() in C

2009-04-06 Thread Paul Smith
o be set. */ >> > #endif >> > #include >> > >> > /* Note that use of this function involves a prior call to the Rmath >> > library to >> >   get the seeds in place. It is assumed that this is done in the calling >> >   function. */

Re: [R] R interpreter not recognized

2009-04-09 Thread Paul Smith
On Thu, Apr 9, 2009 at 9:01 AM, Maria I. Tchalakova wrote: > I am trying to install a program based on R, but I am receiving the > following error message: > r...@darkstar:/home/maria/UCS# perl System/Install.perl > Error: Can't run the R interpreter (/usr/local/bin/R). > Please make sure that R i

Re: [R] Generating random integers

2009-04-12 Thread Paul Smith
On Sun, Apr 12, 2009 at 1:21 PM, jim holtman wrote: > floor(runif(1000, 1,101)) > >>   I need to generate random integer(s) in a range (say that beetween 1 to >>   100) in R. Another way: sample(1:100,1000,replace=T) Paul __ R-help@r-project.org mail

Re: [R] Quantative procedure assessing if data is normal

2009-04-13 Thread Paul Smith
On Mon, Apr 13, 2009 at 7:42 AM, Henry Cooper wrote: > As part of an R code assingment I have been asked to find a quantitative > procedure for assessing whether or not the data are normal? > > I have previously used the graphical procedure using the qqnorm command. > > Any help/tips would be gre

Re: [R] nls factor

2009-04-15 Thread Paul Smith
On Wed, Apr 15, 2009 at 1:27 PM, Manuel Gutierrez wrote: > I want to fit the model y=a*x^b using nls; where "a" should be different for > each level of a factor. > What is the easiest way to fit it? Can i do it with nls? > I've looked the help pages and the MASS example in page 249 but the formula

Re: [R] nls factor

2009-04-15 Thread Paul Smith
On Wed, Apr 15, 2009 at 2:33 PM, Paul Smith wrote: > On Wed, Apr 15, 2009 at 1:27 PM, Manuel Gutierrez > wrote: >> I want to fit the model y=a*x^b using nls; where "a" should be different for >> each level of a factor. >> What is the easiest way to fit it? Ca

Re: [R] issue with L-BFGS-B in optim (optim just hangs)

2009-04-15 Thread Paul Smith
On Wed, Apr 15, 2009 at 3:57 PM, Tiago Marques wrote: > I am using optim, with method=L-BFGS-B, to maximize a likelihood inside a > large simulation exercise. This runs fine for most simulated data sets, but > for some reason, about 1 out of 100 times, optim will just hang. > Using a dumb approach

Re: [R] "reverse truncate" to extract only decimal values

2009-04-16 Thread Paul Smith
On Thu, Apr 16, 2009 at 10:30 PM, T.D.Rudolph wrote: > Is there a way of truncating in the opposite direction so as to retain only > the values to the right of the decimal?? > > i.e. rather than: >> trunc(39.5) > [1] 39 > > i would get something like: >> revtrunc(39.5) > [1] 0.5 > > I've been sear

Re: [R] is there a way to read a specific column from a txt file

2009-05-03 Thread Paul Smith
On Sun, May 3, 2009 at 6:36 PM, Wensui Liu wrote: > Sometimes, it is too costly to read the whole data file into R. > I am looking for solution in scan() and read.Lines() but don't they work. Try the following (assuming a 3 columns data file): mydata <- read.table(file="myfile",header=T,colClass

[R] Code of the max() function

2009-05-04 Thread Paul Smith
Dear All, Where can one find the code of the max() function? Is that written in C? Thanks in advance, Paul __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/post

Re: [R] Code of the max() function

2009-05-04 Thread Paul Smith
On Mon, May 4, 2009 at 7:47 PM, David Winsemius wrote: >> Where can one find the code of the max() function? Is that written in C? > > pages 43-54 of: > > http://cran.r-project.org/doc/Rnews/Rnews_2006-4.pdf > > ... is an article by Uwe Ligges on accesssing source code. Thanks, David. That is it!

[R] Looking for package for data generation for classification and regression

2022-03-03 Thread Paul Smith
Dear All, I am in need of generating artificial data for machine learning classification and regression analysis. What I am looking for is something similar to Python sklearn.datasets.make_classification and sklearn.datasets.make_regression: https://scikit-learn.org/stable/modules/generated/sklea

Re: [R] Looking for package for data generation for classification and regression

2022-03-04 Thread Paul Smith
On Fri, Mar 4, 2022 at 8:07 AM Ranjan Maitra wrote: > > > I am in need of generating artificial data for machine learning > > classification and regression analysis. What I am looking for is > > something similar to Python sklearn.datasets.make_classification and > > sklearn.datasets.make_regressi

[R] kableExtra: How to change kable font family

2019-05-26 Thread Paul Smith
Dear All, Is it possible to change the font family to typewriter of the tables generated by kable from kableExtra package? Thanks in advance, Paul __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listin

Re: [R] kableExtra: How to change kable font family

2019-05-27 Thread Paul Smith
Thanks, Jeff, but apparently there is no option to change font family through cell_spec. Paul On Mon, May 27, 2019 at 2:22 AM Jeff Newmiller wrote: > > Perhaps... ?cell_spec > > On May 26, 2019 11:13:04 AM PDT, Paul Smith wrote: > >Dear All, > > > >Is it possibl

Re: [R] kableExtra: How to change kable font family

2019-05-27 Thread Paul Smith
Yes, Jeff, that works! Thanks! However, if I wanted to change the font family to a family different of typewriter, I guess it would be impossible. Paul On Mon, May 27, 2019 at 2:17 PM Jeff Newmiller wrote: > > What about the "monospace" setting? > > On May 27, 2019 1:08

[R] Testing correlation of equation in a SUR model fitted by systemfit

2014-04-15 Thread Paul Smith
Dear All, How to test whether the correlation in the matrix of correlation of a two-equations SUR model fitted by package systemfit are significant? Thanks in advance, Paul __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-h

Re: [R] (no subject)

2010-07-24 Thread Paul Smith
2010/7/23 w 霍 : > I use the constrOptim to maximize a function with four constriants but the > answer does not leave from the starting value and there is only one outer > iteration. The function is defined as follows: > tm<-function(p){ > p1<-p[1]; p2<-p[2]; p3<-p[3]; > p4<-1-p1-p2-p3; > p1*p2*p3

[R] Bug on r-bc?

2010-07-26 Thread Paul Smith
Dear All, The following code should return 1, but it returns 0: source("http://r-bc.googlecode.com/svn/trunk/R/bc.R";) bc("9 % 2") Do you confirm this bug? Paul __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE

Re: [R] Bug on r-bc?

2010-07-26 Thread Paul Smith
On Mon, Jul 26, 2010 at 11:42 PM, Gabor Grothendieck wrote: >> The following code should return 1, but it returns 0: >> >> source("http://r-bc.googlecode.com/svn/trunk/R/bc.R";) >> bc("9 % 2") >> > > See FAQ 2 on the r-bc package home page: > http://r-bc.googlecode.com Thanks to all respondents f

Re: [R] Bug on r-bc?

2010-07-27 Thread Paul Smith
On Tue, Jul 27, 2010 at 5:12 AM, Gabor Grothendieck wrote: The following code should return 1, but it returns 0: source("http://r-bc.googlecode.com/svn/trunk/R/bc.R";) bc("9 % 2") >>> >>> See FAQ 2 on the r-bc package home page: >>> http://r-bc.googlecode.com >> >> Thanks

Re: [R] constrained optimization -which package?

2010-09-28 Thread Paul Smith
On Tue, Sep 28, 2010 at 9:47 PM, Leonardo Monasterio wrote: > In the function bellow I  want to find the maximum value of v, > subject to the constrain that the sum of x is equal to 1. >  I want to maximize: > v<-t(x)%*%distance%*%x > > Subject to: > sum(x)=1 > > Where: > "x" is a vector n X 1 > "

Re: [R] "Nash Equilibrium"

2010-12-04 Thread Paul Smith
On Sat, Dec 4, 2010 at 10:09 AM, Christophe Dutang wrote: > Months ago, when I wanted to compute Nash equilibria (both standard and > generalized), I only found one package that implements the discrete, i.e. > when the player payoff is represented by a matrix. Could you please tell us which R p

[R] Plot and curve inside C++

2011-03-06 Thread Paul Smith
Dear All, I would like to use - plot, - curve inside a C++ program. What R package do you recommend? Rcpp? Thanks in advance, Paul __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide htt

[R] Automatic creation of binary logistic models

2011-08-04 Thread Paul Smith
Dear All, Suppose that you are trying to create a binary logistic model by trying different combinations of predictors. Has R got an automatic way of doing this, i.e., is there some way of automatically generating different tentative models and checking their corresponding AIC value? If so, could

Re: [R] Automatic creation of binary logistic models

2011-08-04 Thread Paul Smith
e bestglm() package will do the trick. > Jeremy > > On 4 August 2011 12:23, Paul Smith wrote: >> >> Dear All, >> >> Suppose that you are trying to create a binary logistic model by >> trying different combinations of predictors. Has R got an automatic >> way o

Re: [R] Automatic creation of binary logistic models

2011-08-04 Thread Paul Smith
On Thu, Aug 4, 2011 at 9:35 PM, Marc Schwartz wrote: >> Suppose that you are trying to create a binary logistic model by >> trying different combinations of predictors. Has R got an automatic >> way of doing this, i.e., is there some way of automatically generating >> different tentative models an

[R] Can glmnet handle models with numeric and categorical data?

2011-08-04 Thread Paul Smith
Dear All, Can the x matrix in the glmnet() function of glmnet package be a data.frame with numeric columns and factor columns? I am asking this because I have a model with both numeric and categorical predictors, which I would like to study with glmnet. I have already tried to use a data.frame, bu

Re: [R] Can glmnet handle models with numeric and categorical data?

2011-08-04 Thread Paul Smith
On Fri, Aug 5, 2011 at 12:02 AM, Marc Schwartz wrote: >> Can the x matrix in the glmnet() function of glmnet package be a >> data.frame with numeric columns and factor columns? I am asking this >> because I have a model with both numeric and categorical predictors, >> which I would like to study w

Re: [R] Can glmnet handle models with numeric and categorical data?

2011-08-05 Thread Paul Smith
On Fri, Aug 5, 2011 at 8:45 AM, Martin Maechler wrote: > Note the following: As soon as you use "categorical predictors", > i.e., factors, and particularly when these have many levels (instead of just > being binary), the resulting model matrix is often sparse, > i.e. contains many zeros. > When t

[R] Goodness of fit of binary logistic model

2011-08-05 Thread Paul Smith
Dear All, I have just estimated this model: --- Logistic Regression Model lrm(formula = Y ~ X16, x = T, y = T) Model Likelihood DiscriminationRank Discrim. Ratio TestIndexes

Re: [R] Goodness of fit of binary logistic model

2011-08-05 Thread Paul Smith
On Fri, Aug 5, 2011 at 4:54 PM, David Winsemius wrote: >> I have just estimated this model: >> --- >> Logistic Regression Model >> >> lrm(formula = Y ~ X16, x = T, y = T) >> >>                    Model Likelihood     Discrimination    Rank Di

Re: [R] Goodness of fit of binary logistic model

2011-08-05 Thread Paul Smith
On Fri, Aug 5, 2011 at 5:35 PM, David Winsemius wrote: I have just estimated this model: --- Logistic Regression Model lrm(formula = Y ~ X16, x = T, y = T)                   Model Likelihood     Discriminati

Re: [R] Goodness of fit of binary logistic model

2011-08-05 Thread Paul Smith
On Fri, Aug 5, 2011 at 7:07 PM, David Winsemius wrote: >> I have just estimated this model: >> --- >> Logistic Regression Model >> >> lrm(formula = Y ~ X16, x = T, y = T) >> >>                  Model Likelihood    

Re: [R] Goodness of fit of binary logistic model

2011-08-05 Thread Paul Smith
Thanks, Frank. The following piece of code generate data, which exhibit the problem I reported: - set.seed(123) intercept = -1.32 beta = 1.36 xtest = rbinom(1000,1,0.5) linpred = intercept + xtest*beta prob = exp(linpred)/(1 + exp(linpred)) runis = runif(100

Re: [R] Goodness of fit of binary logistic model

2011-08-06 Thread Paul Smith
diately see that this model MUST fit the data, so > that any evidence for lack of fit has to be misleading. > > Frank > > Peter Dalgaard-2 wrote: >> >> On Aug 5, 2011, at 23:16 , Paul Smith wrote: >> >>> Thanks, Frank. The following piece

[R] How to change the color of the bar lines of a histogram?

2011-08-18 Thread Paul Smith
Dear All, How to change the color of the bar lines of a histogram? I have read ?hist which mentions the parameter 'col', but this one is to configure the color of the bars filling. Thanks in advance, Paul __ R-help@r-project.org mailing list https:/

Re: [R] How to change the color of the bar lines of a histogram?

2011-08-18 Thread Paul Smith
That is it, Uwe! Thanks! Paul 2011/8/18 Uwe Ligges : > Read further on and find "border": > > >  hist(rnorm(10), border="yellow") > > > Uwe Ligges > > On 18.08.2011 13:14, Paul Smith wrote: >> >> Dear All, >> >> How to ch

[R] Function for running a sign test

2011-09-19 Thread Paul Smith
Dear All, Has R got a function to perform a sign test? I have done some searching but with no luck. Thanks in advance, Paul __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R

Re: [R] Function for running a sign test

2011-09-19 Thread Paul Smith
ot; returned both several functions and > a website stating authoritatively that "there is no R function for the > sign test," so its all a matter of your chosen authority, I suppose. > > Sarah > > On Mon, Sep 19, 2011 at 6:10 AM, Paul Smith wrote: >> Dear All, >>

Re: [R] Event Studies in R

2012-06-23 Thread Paul Smith
I suspect Ivan is looking for packages to do discrete-event simulation like simulation of queues. Paul On Sat, Jun 23, 2012 at 5:15 PM, Jim Porzak wrote: > Ivan, > You need to be more specific if you want an answer. What kind of > events? With or without attributes? > Species extinction? Formul

[R] Drawing a histogram from a massive dataset

2011-07-15 Thread Paul Smith
Dear All, I have a massive dataset from which I would like to draw a histogram. Any ideas on how to accomplish this? Thanks in advance, Paul __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting g

Re: [R] Drawing a histogram from a massive dataset

2011-07-18 Thread Paul Smith
repeat). > > HTH, > Dennis > > On Fri, Jul 15, 2011 at 4:21 AM, Paul Smith wrote: >> Dear All, >> >> I have a massive dataset from which I would like to draw a histogram. >> Any ideas on how to accomplish this? >> >> Thanks in advance, >> >

Re: [R] Drawing a histogram from a massive dataset

2011-07-18 Thread Paul Smith
On Mon, Jul 18, 2011 at 9:11 PM, Joshua Wiley wrote: >> [snip] I guess that I must have a data frame to plot a histogram. > > Not at all! > > ## a *vector* of 100 million observation > x <- rnorm(10^8) > ## a histogram for it (see attached for the result from my system) > hist(x) > > No data frame

Re: [R] Drawing a histogram from a massive dataset

2011-07-19 Thread Paul Smith
On Tue, Jul 19, 2011 at 12:30 AM, Joshua Wiley wrote: [snip] I guess that I must have a data frame to plot a histogram. >>> >>> Not at all! >>> >>> ## a *vector* of 100 million observation >>> x <- rnorm(10^8) >>> ## a histogram for it (see attached for the result from my system) >>> hist(x)

Re: [R] Solving quadratic equation in R

2012-07-27 Thread Paul Smith
On Thu, Jul 26, 2012 at 9:48 PM, Diviya Smith wrote: > Hi there, > > I would like to solve a simple equation in R > > a^2 - a = 8.313 > > There is no real solution to this problem but I would like to get an > approximate numerical solution. Can someone suggest how I can set this up? Since your eq

[R] Extraction of rules from Support Vector Machines

2011-12-15 Thread Paul Smith
Dear All, I am using the svm() function of package e1071 for creating Support Vector Machines prediction models. As far as I understand, there is no function in this package to extract rules of prediction. Is there some other package with such a functionality? Thanks in advance, Paul __

Re: [R] Extraction of rules from Support Vector Machines

2011-12-18 Thread Paul Smith
2011/12/17 Uwe Ligges : >> I am using the svm() function of package e1071 for creating Support >> Vector Machines prediction models. As far as I understand, there is no >> function in this package to extract rules of prediction. Is there some >> other package with such a functionality? > > Those "r

Re: [R] Maximization

2011-10-30 Thread Paul Smith
On Tue, Oct 25, 2011 at 12:04 PM, Eliano wrote: > hi people, > > I'm trying to maximize this function: > > fn= function (x) {x[1]^2+5*x[2]^2} > > with this restriction > fn1 = function (x) {x[1]+x[2] <=5} > > Can someone help me how to procedure this? > > I tried in the alabama and genoud package

Re: [R] Pros and Cons of R

2008-05-22 Thread Paul Smith
On Thu, May 22, 2008 at 5:00 PM, Monica Pisica <[EMAIL PROTECTED]> wrote: > - It seems that it is hard to install correctly under Linux. Actually, it is quite easy to install R under Linux, at least in some distributions. For instance, on Fedora: yum install R R-devel and that is it. Paul

Re: [R] optimization setup

2008-05-30 Thread Paul Smith
On Fri, May 30, 2008 at 12:04 PM, threshold <[EMAIL PROTECTED]> wrote: > Thanks for all your replies and sorry for a negligence in my examples. They > are very simplified to reflect very roughly the structure of the case I deal > with, which is too complicated to be quoted here. > > What I deal wit

Re: [R] Swap variables in data.frame

2008-06-02 Thread Paul Smith
On Mon, Jun 2, 2008 at 11:59 AM, Blubbele <[EMAIL PROTECTED]> wrote: > > Thanks but it swaps in both cases only the data: > > FemMal_88[c(61,62)]=FemMal_88[c(62,61)] > > > FemMal_88[,c(61,62)]=FemMal_88[,c(62,61)] The following works: d <- data.frame(a=c(1,2),b=c(3,4)) d <- d[,c(2,1)] Paul

Re: [R] Swap variables in data.frame

2008-06-02 Thread Paul Smith
On Mon, Jun 2, 2008 at 1:04 PM, Birgitle <[EMAIL PROTECTED]> wrote: > > Thanks Paul. > > I am not sure if I understood well, but when I do it then I have only two > columns left: > >> L3 <- LETTERS[1:3] >> (d <- data.frame(cbind(x=1, y=1:10, z=11:20), fac=sample(L3, 10, >> replace=TRUE))) > x y

Re: [R] How can I solve this function in R?

2008-06-02 Thread Paul Smith
On Mon, Jun 2, 2008 at 4:31 PM, François Aucoin <[EMAIL PROTECTED]> wrote: > I would like to solve the following function in R: > > G <- function(k) (2*(1 - k)*(1 + 2*k)^.5)/(1+3*k) > > I want to be able to find "k" for a given "G" Consider G(k)-g. With plot look for intervals where the roots lie

Re: [R] txt file, 14000+ rows, only last 8000 appear

2008-06-07 Thread Paul Smith
On Fri, Jun 6, 2008 at 10:30 PM, RobertsLRRI <[EMAIL PROTECTED]> wrote: > > when I load my data file in txt format into the R workstation I lose about > 6000 rows, this is a problem. Is there a limit to the display capabilities > for the workstation? is all the information there and I just can't

Re: [R] Need to run R on Fedora 9.

2008-06-08 Thread Paul Smith
On Sun, Jun 8, 2008 at 9:33 AM, Peter Dalgaard <[EMAIL PROTECTED]> wrote: >>> I'm in need of a version of R that will run on fedora 9 and haven't been >>> able >>> to find one. I need this in order to run Bioconductor. Any advice? >> >> Why not say (as root) >> yum install R >> ? >> >> Worked for

Re: [R] Can R do this ?

2008-07-08 Thread Paul Smith
On Tue, Jul 8, 2008 at 6:59 AM, Daren Tan <[EMAIL PROTECTED]> wrote: > > I have a folder full of pngs and jpgs, and would like to consolidate them > into a pdf with appropriate title and labels. Can this be done via R ? I do not know whether R can do that. However, you can accomplish that easily

Re: [R] Constrained optimization

2008-07-08 Thread Paul Smith
On Tue, Jul 8, 2008 at 11:28 AM, Kanak Choudhury <[EMAIL PROTECTED]> wrote: > i have a function like > > 1+sin(a+bx) where -pi/2<=a+bx<=pi/2 > > i made a progrom using constrOptim() function but it is not giving good > result. it depends on the initial value. but when i am doing simulation it > is

Re: [R] Optimization with nonlinear constraints

2008-03-26 Thread Paul Smith
On Wed, Mar 26, 2008 at 1:17 PM, Andreas Klein <[EMAIL PROTECTED]> wrote: > I have some further problems with modelling an > optimization problem in R: > > How can I model some optimization problem in R with a > linear objective function with subject to some > nonlinear constraints? > I would

Re: [R] generate random numbers subject to constraints

2008-03-26 Thread Paul Smith
On Wed, Mar 26, 2008 at 7:27 PM, Ala' Jaouni <[EMAIL PROTECTED]> wrote: > I failed to mention that the X values have to be positive and between 0 and > 1. Use Robert's method, and to do his step 1, use runif (?runif) to get random numbers from the uniform distribution between 0 and 1. Paul ___

[R] Cannot update packages on F8

2008-03-27 Thread Paul Smith
Dear All, I have just updated R to the version 2.6.2 on F8 (with the official F8 rpm). However, when running as root the following command: update.packages(checkBuilt=T) I get a bunch of errors like the ones below. Any ideas? Thanks in advance, Paul ---

Re: [R] Cannot update packages on F8

2008-03-27 Thread Paul Smith
On Thu, Mar 27, 2008 at 10:20 PM, Marc Schwartz <[EMAIL PROTECTED]> wrote: > > I have just updated R to the version 2.6.2 on F8 (with the official F8 > > rpm). However, when running as root the following command: > > > > update.packages(checkBuilt=T) > > > > I get a bunch of errors like the o

Re: [R] DE optimization with equality constraint

2008-03-29 Thread Paul Smith
On Sat, Mar 29, 2008 at 9:33 PM, Hans W. Borchers <[EMAIL PROTECTED]> wrote: > > Reply to "Optimization with constraint" on March 14, 2008 > > One can get an accurate solutons applying the "Differential Evolution" > algorithm > as implemented in the DEoptim package: > > f2 <- function(x){ >

[R] L-BFGS-B needs finite values of 'fn'

2008-03-31 Thread Paul Smith
Dear All, I am trying to solve the optimization problem below, but I am always getting the following error: Error in optim(rep(20, nvar), f, gr, method = "L-BFGS-B", lower = rep(0, : L-BFGS-B needs finite values of 'fn' Any ideas? Thanks in advance, Paul ---

  1   2   3   >