Re: [R] Query on finding root

2023-08-28 Thread Ben Bolker
(I mean pdavies) On Mon, Aug 28, 2023, 7:52 AM Ben Bolker wrote: > I would probably use the built in qdavies() function... > > On Mon, Aug 28, 2023, 7:48 AM Leonard Mada via R-help < > r-help@r-project.org> wrote: > >> Dear R-Users, >> >> Just out of curiosity: >> Which of the 2 methods is the b

Re: [R] Query on finding root

2023-08-28 Thread Ben Bolker
I would probably use the built in qdavies() function... On Mon, Aug 28, 2023, 7:48 AM Leonard Mada via R-help wrote: > Dear R-Users, > > Just out of curiosity: > Which of the 2 methods is the better one? > > The results seem to differ slightly. > > > fun = function(u){((26104.50*u^0.03399381)/((

Re: [R] Query on finding root

2023-08-28 Thread Leonard Mada via R-help
Dear R-Users, Just out of curiosity: Which of the 2 methods is the better one? The results seem to differ slightly. fun = function(u){((26104.50*u^0.03399381)/((1-u)^0.107)) - 28353.7} uniroot(fun, c(0,1)) # 0.6048184 curve(fun(x), 0, 1) abline(v=0.3952365, col="red") abline(v=0.6048184,

Re: [R] Query on finding root

2023-08-27 Thread Ben Bolker
This doesn't look like homework to me -- too specific. The posting guide says that the list is not intended for "Basic statistics and classroom homework" -- again, this doesn't seem to fall into that category. tl;dr, I think the difference b

Re: [R] Query on finding root

2023-08-27 Thread Rolf Turner
On Fri, 25 Aug 2023 22:17:05 +0530 ASHLIN VARKEY wrote: > Sir, Please note that r-help is a mailing list, not a knight! 😊️ > I want to solve the equation Q(u)=mean, where Q(u) represents the > quantile function. Here my Q(u)=(c*u^lamda1)/((1-u)^lamda2), which is > the quantile function of Dav

Re: [R] Query on finding root

2023-08-26 Thread J C Nash
Homework? On 2023-08-25 12:47, ASHLIN VARKEY wrote: Sir, I want to solve the equation Q(u)=mean, where Q(u) represents the quantile function. Here my Q(u)=(c*u^lamda1)/((1-u)^lamda2), which is the quantile function of Davies (Power-pareto) distribution. Hence I want to solve , *(c*u^lamda1)/((1

[R] Query on finding root

2023-08-26 Thread ASHLIN VARKEY
Sir, I want to solve the equation Q(u)=mean, where Q(u) represents the quantile function. Here my Q(u)=(c*u^lamda1)/((1-u)^lamda2), which is the quantile function of Davies (Power-pareto) distribution. Hence I want to solve , *(c*u^lamda1)/((1-u)^lamda2)=28353.7(Eq.1)* where lamda1=0.03399381,

Re: [R] Query about code

2023-04-22 Thread Jim Lemon
Hi Yeswanth, As it says on the bottom ofthe first page, the corresponding author it: yangj...@ms.xjb.ac.cn Try that email address. Jim On Sat, Apr 22, 2023 at 2:59 PM ADIGARLA YESWANTH NAIDU <102213...@smail.iitpkd.ac.in> wrote: > > Thanks for your reply sir , > Here is the reference,I want to

Re: [R] Query about code

2023-04-21 Thread Bert Gunter
"Perhaps you could supply a reference to the work you are using?" ... in which case they should simply email the author directly, no? -- Bert On Fri, Apr 21, 2023 at 3:22 PM Jim Lemon wrote: > > Hi Yeswanth, > You seem to be referring to a specific publication by a specific > author. Unless som

Re: [R] Query about code

2023-04-21 Thread Jim Lemon
Hi Yeswanth, You seem to be referring to a specific publication by a specific author. Unless someone in R-help knows who and what you are referring to, it seems very difficult. Perhaps you could supply a reference to the work you are using? JIm On Sat, Apr 22, 2023 at 7:03 AM ADIGARLA YESWANTH NA

[R] Query about code

2023-04-21 Thread ADIGARLA YESWANTH NAIDU
I have been trying to write the code for the CCM analysis that you used in your study, but unfortunately, I haven't been able to write it. I was wondering if you would be willing to share the code with me. I understand that the code may be your intellectual property, but I assure you that I will us

Re: [R] query in loops

2022-12-05 Thread jim holtman
So what is the problem that you would like help in correcting? The program seems to run. Thanks Jim Holtman *Data Munger Guru* *What is the problem that you are trying to solve?Tell me what you want to do, not how you want to do it.* On Mon, Dec 5, 2022 at 12:59 PM ASHLIN VARKEY wrote: > S

[R] query in loops

2022-12-05 Thread ASHLIN VARKEY
Sir, I want to write a loop in R to find the AIC factor. For its calculation, I need to run an algorithm in the attached file. Here 'x' represents the dataset and xi denotes the i-th observation after arranging it in ascending order. Q(u) and q(u) represent the quantile function and quantile densi

Re: [R] Query regarding R 'irr' package 'N.cohen.kappa'

2022-06-16 Thread Jim Lemon
Hi Kalaivani, The N.cohen.kappa function was written by Matthais Gamer, the maintainer of the irr package. Both that function and N2.cohen.kappa (written by Puspendra Singh) involve corrections that are described in the references on the respective help pages. It is likely that there will be small

[R] Query regarding R 'irr' package 'N.cohen.kappa'

2022-06-16 Thread Kalaivani Mani
Dear R-help Team, I am from India and have a query on 'N.cohen.kappa' Sample size calculations for Cohen's Kappa Statistic. I have calculated manually the sample size using the formula mentioned in "Cantor, A. B. (1996) Sample-size calculation for Cohen’s kappa. Psychological Methods, 1, 150- 153"

Re: [R] Query regarding stats/p.adjust package (base) - specifically 'Hochberg' function

2021-08-24 Thread Jim Lemon
This is beginning to sound like a stats taliban fatwa. I don't care if you're using an abacus, you want to get the correct result. My guess is that the different instantiations of the Hochberg adjustment are using different algorithms to calculate the result. The Hochberg adjustment is known to be

Re: [R] Query regarding stats/p.adjust package (base) - specifically 'Hochberg' function

2021-08-24 Thread Rolf Turner
On Tue, 24 Aug 2021 14:44:55 + David Swanepoel wrote: > Dear R Core Dev Team, I hope all is well your side! > My apologies if this is not the correct point of contact to use to > address this. If not, kindly advise or forward my request to the > relevant team/persons. > > I have a query re

Re: [R] Query regarding stats/p.adjust package (base) - specifically 'Hochberg' function

2021-08-24 Thread David Swanepoel
bject: Re: [R] Query regarding stats/p.adjust package (base) - specifically 'Hochberg' function 1. No Excel attachments made it through. Binary attachments are generally stripped by the list server for security reasons. 2. As you may have already learned, this is the wrong forum fo

Re: [R] Query regarding stats/p.adjust package (base) - specifically 'Hochberg' function

2021-08-24 Thread Martin Maechler
> Bert Gunter > on Tue, 24 Aug 2021 10:50:50 -0700 writes: > 1. No Excel attachments made it through. Binary > attachments are generally stripped by the list server for > security reasons. > 2. As you may have already learned, this is the wrong > forum for statist

Re: [R] Query regarding stats/p.adjust package (base) - specifically 'Hochberg' function

2021-08-24 Thread Bert Gunter
1. No Excel attachments made it through. Binary attachments are generally stripped by the list server for security reasons. 2. As you may have already learned, this is the wrong forum for statistics or package specific questions. Read *and follow* the posting guide linked below to post on r-help a

Re: [R] Query

2021-04-26 Thread Rui Barradas
tact the maintainer("vars") ? Hope this helps, Rui Barradas Às 18:31 de 25/04/21, Sun Yong Kim escreveu: vars package From: John Kane Sent: Sunday, April 25, 2021 12:30 PM To: Sun Yong Kim Cc: r-help@r-project.org Subject: Re: [R] Query What package

Re: [R] Query

2021-04-26 Thread Jim Lemon
n Kane > Sent: Sunday, April 25, 2021 12:30 PM > To: Sun Yong Kim > Cc: r-help@r-project.org > Subject: Re: [R] Query > > What package has the irf function? > > On Fri, 23 Apr 2021 at 09:34, Sun Yong Kim > wrote: > > > > Hi > > > > I have been trying

Re: [R] Query

2021-04-26 Thread Sun Yong Kim
vars package From: John Kane Sent: Sunday, April 25, 2021 12:30 PM To: Sun Yong Kim Cc: r-help@r-project.org Subject: Re: [R] Query What package has the irf function? On Fri, 23 Apr 2021 at 09:34, Sun Yong Kim wrote: > > Hi > > I have been trying

Re: [R] Query

2021-04-25 Thread John Kane
What package has the irf function? On Fri, 23 Apr 2021 at 09:34, Sun Yong Kim wrote: > > Hi > > I have been trying to circulate a question but my question keeps getting > rejected. Let me try again via email. The message is below: > > I am trying to change the tick size for IRF graphs that I cre

[R] Query

2021-04-23 Thread Sun Yong Kim
Hi I have been trying to circulate a question but my question keeps getting rejected. Let me try again via email. The message is below: I am trying to change the tick size for IRF graphs that I created using the following code below: par(mfrow=c(2,3)) IRF_F2 <- irf(SVARmod1, impulse="deltaw2",

Re: [R] Query on constrained regressions using -mgcv- and -pcls-

2020-11-02 Thread Bert Gunter
Warning: I did *not* attempt to follow your query(original or addendum) in detail. But as you have not yet received a reply, it may be because your post seems mostly about statistical issues, which are generally off topic here. This list is primarily about R programming issues. If statistical issue

Re: [R] Query on constrained regressions using -mgcv- and -pcls-

2020-11-02 Thread Clive Nicholas via R-help
As an addendum / erratum to my original post, the second block of code should read for completeness: set.seed(02102020) N=500 M=10 rater=rep(1:M, each = N) lead_n=as.factor(rep(1:N,M)) a=rep(rnorm(N),M) z=rep(round(25+2*rnorm(N)+.2*a)) x=a+rnorm(N*M) y=.5*x+5*a-.5*z+2*rnorm(N*M) x_cl=rep(aggregate

[R] Query on constrained regressions using -mgcv- and -pcls-

2020-11-02 Thread Clive Nicholas via R-help
Hello all, I'll level with you: I'm puzzled! How is it that this constrained regression routine using -pcls- runs satisfactorily (courtesy of Tian Zheng): library(mgcv) options(digits=3) x.1=rnorm(100, 0, 1) x.2=rnorm(100, 0, 1) x.3=rnorm(100, 0, 1) x.4=rnorm(100, 0, 1) y=1+0.5*x.1-0.2*x.2+0.3*x

Re: [R] Query on contour plots

2020-06-02 Thread Abby Spurdle
> The contour lines are actually useful to see groupings. > However w/o a legend for density it is not possible to see what is > presented. I need to re-iterate, that the diagonal lines, may be important. Also, I'm not sure I see the point in adding density values. Unless people have a good knowl

Re: [R] Query on contour plots

2020-06-02 Thread Abby Spurdle
> that extraneous white lines in PDFs are the fault of the PDF > viewing program rather than of R. Except it's a PNG file. I've tried to minimize artifacts viewing PDF files. But assumed (falsely?) that PNGs and other raster formats, would be fine. __

Re: [R] Query on contour plots

2020-06-02 Thread Neotropical bat risk assessments
Tnx Jim, Yes if there is a way to first extract the ranges of each data files Fc range and Sc ranges and then link to the plot that would be stellar. I will look at this code and see how it is working so far. Thanks a million. Bruce Hi Bruce & Abby, Here is a start on merging the two plots. A

Re: [R] Query on contour plots

2020-06-02 Thread David Winsemius
On 6/2/20 11:44 AM, Abby Spurdle wrote: Very nice Jim, thank you. However, the (deterministic, or near-deterministic) diagonal lines in the plot, make me question the suitability of this approach. In my plot, the contour lines could be removed, and brighter colors could be used. But perhaps,

Re: [R] Query on contour plots

2020-06-02 Thread Jim Lemon
Hi Bruce & Abby, Here is a start on merging the two plots. Abby - I had to cheat on the legend colors as I could not work out from the help pages how to specify the range of colors. Also I don't know the range of densities. Both should be easy to fix. While I specified xlab and ylab, they don't see

Re: [R] Query on contour plots

2020-06-02 Thread Neotropical bat risk assessments
Hi Abby, The contour lines are actually useful to see groupings. However w/o a legend for density it is not possible to see what is presented. Very nice Jim, thank you. However, the (deterministic, or near-deterministic) diagonal lines in the plot, make me question the suitability of this appr

Re: [R] Query on contour plots

2020-06-02 Thread Abby Spurdle
> Very nice Jim, thank you. However, the (deterministic, or near-deterministic) diagonal lines in the plot, make me question the suitability of this approach. In my plot, the contour lines could be removed, and brighter colors could be used. But perhaps, a better approach would be to model those

Re: [R] Query on contour plots

2020-06-02 Thread Neotropical bat risk assessments
Hi all, I spent some time this morning fiddling with the parameters in the plot code provided by Jim and Abby and  by changing some important ones. Jim did note *# set the matrix limits a bit beyond the data ranges* fcsc_mat<-makeDensityMatrix(bfs$Fc,bfs$Sc,nx=100,ny=100,  zfun="sum",xlim=c(*30

Re: [R] Query on contour plots

2020-06-02 Thread Neotropical bat risk assessments
Hi all, Many thanks for the efforts and suggestions. This is getting closer to what is needed.  No legend showing the density values yet. I was able to replicate a similar plot with the original data set. However when I tried this with a different data set that has other Fc & Sc values  the plo

Re: [R] Query on contour plots

2020-06-02 Thread Jim Lemon
Very nice. I forgot that you didn't have the complete data set. png("as_bat_call.png") plot_ds (bfs[,c("Fc","Sc")], "plot 1", xlim = c (25, 30), ylim = c (-15, 10), k1=1.25, k2=1.25) dev.off() Jim On Tue, Jun 2, 2020 at 6:24 PM Abby Spurdle wrote: > > I'm putting this back on the list.

Re: [R] Query on contour plots

2020-06-02 Thread Abby Spurdle
I'm putting this back on the list. > So how would I set up the code to do this with the data type I have? > I will need to replicate the same task > 200 times with other data sets. > What I need to do is plot *Fc *against *Sc* with the third dimension being > the *density* of the data points. U

Re: [R] Query on contour plots

2020-06-01 Thread Jim Lemon
Good morning Bruce & Abby, The fruit bats of Sydney have retreated to their camps so I can finally answer your last two queries. Attached is a plot of your data set on a 100 x 100 grid. This is how I did it: bfs<-read.csv("Procen_sample.csv") dim(bfs) names(bfs) library(plotrix) # set the matrix l

Re: [R] Query on contour plots

2020-06-01 Thread Abby Spurdle
Hi, I'm probably biased. But my package, bivariate, contains a wrapper for KernSmooth::bkde2D, which can produce both 3D surface plots and (pretty) contour plots of bivariate kernel density estimates, conveniently. https://cran.r-project.org/web/packages/bivariate/vignettes/bivariate.pdf (pages

Re: [R] Query on contour plots

2020-05-31 Thread Jim Lemon
Hi Bruce, With a much larger data set, you would see a smoother plot like your sample. I plotted frequency as the abcissa and slope as the ordinate. It looks as though your sample has it the other way round and the plot limits are extended beyond the range of the data. However, makeDensityMatrix an

Re: [R] Query on contour plots

2020-05-31 Thread Jim Lemon
Hi Neo, It's a bit of a guess, but try this: bat_call<-read.table(text="Fc Sc 26.58 -5.95 27.03 -8.2 27.16 -2.07 26.19 -7.68 26.62 -3.99 26.85 -6.08 26.94 0 26.1-5.74 26.62 -5.96 26.85 -4.05 26.98 -4.09 26.02 -5.69 26.53 -7.89 26.62 -2 26.8-4.04 28.73 7 25.

[R] Query on contour plots

2020-05-31 Thread Neotropical bat risk assessments
Hi all, While exploring  packages for 3D plots that several folks suggested (Tnx all!) It seems what I really need is a contour plot.  This is not working int he Deducer GUI. This will be an aid to separating bats by their vocal signatures. What I need to do is plot *Fc *against *Sc* with the t

Re: [R] Query on 3d plotting pacakges

2020-05-31 Thread Bert Gunter
1. Search 2. Search! 3. Search!! "3D plotting" at rseek.org (or R 3-d plotting on google) CRAN plotting task view: https://CRAN.R-project.org/view=Graphics ... and you don't even necessarily need 3D plotting if you encode the density with color Ă  la heatmaps. Bert Gunter "The trouble with havi

[R] Query on 3d plotting pacakges

2020-05-31 Thread Neotropical bat risk assessments
Hi all, Fumbling around trying to find a plot package to do 3D plots. This will be an aid to separating bats by their vocal signatures. What I need to do is plot *Fc *against *Sc* with the third dimension being the *density* of the data points in the Fc-Sc plot. Data format is like this abbrevia

Re: [R] Query about calculating the monthly average of daily data columns

2019-10-20 Thread Jim Lemon
Hi Subhamitra, This is not the only way to do this, but if you only want the monthly averages, it is simple: # I had to change the "soft" tabs in your email to commas # in order to read the data in spdf<-read.table(text="PERMNO,DATE,Spread 111,19940103,0.025464308 111,19940104,0.064424296 111,1994

Re: [R] Query about calculating the monthly average of daily data columns

2019-10-20 Thread Rui Barradas
ross your head, you could continue your way. Cheers Petr -Original Message- From: R-help <mailto:r-help-boun...@r-project.org> On Behalf Of Subhamitra Patra Sent: Friday, September 13, 2019 3:20 PM To: Jim Lemon <mailto:drjimle...@gmail.com>; r-help mailing list http://proj

Re: [R] Query about calculating the monthly average of daily data columns

2019-10-20 Thread jim holtman
1035284691, 8.6464271477849, 10.3412351841865, 10.7577574534162, > > 11.1124067479261, 9.91627943243343, 10.6356898895291, 10.2107566441478, > > 10.0672734202575, 10.2385787014999, 11.7112606160069, 10.0453801263575, > > 8.84654136100724, 10.2173421609193, 9.27919801705716, 10.4755

Re: [R] Query about calculating the monthly average of daily data columns

2019-10-20 Thread Subhamitra Patra
66, 10.5220100705827, 8.74921668696853, > 8.56415116683662, 12.1348451793815, 10.9496674323819, 9.64443817181322, > 9.52977454697087, 10.4281877186725, 8.52701721410292, 11.6911584965782, > 10.2300108250139, 8.65368821276485, 11.7733431942379, 10.2060233777681, > 9.57291673029552, 9.8268

Re: [R] Query about calculating the monthly average of daily data columns

2019-09-16 Thread PIKAL Petr
5, 9.35132038807071, 11.3286703149903, 10.4621597293933, 10.4099459919071, 8.86246315190942, 9.30054044639769, 9.40346575227191, 9.59278722974697)), row.names = c(NA, -260L), class = "data.frame") From: Subhamitra Patra <mailto:subhamitra.pa...@gmail.com> Sent: Friday, September 13, 2019 3:5

Re: [R] Query about calculating the monthly average of daily data columns

2019-09-13 Thread Jim Lemon
Sorry, forgot to include the list. On Sat, Sep 14, 2019 at 10:27 AM Jim Lemon wrote: > > See inline > > On Fri, Sep 13, 2019 at 11:20 PM Subhamitra Patra > wrote: >> >> Dear Sir, >> >> Yes, I understood the logic. But, still, I have a few queries that I >> mentioned below your answers. >> >>>

Re: [R] Query about calculating the monthly average of daily data columns

2019-09-13 Thread Subhamitra Patra
(value column, list(format(date column, "%m.%Y"), country > column), mean) > > But if you insist to scratch your left ear with right hand accross your > head, you could continue your way. > > Cheers > Petr > > > -Original Message- > > From: R-help On

Re: [R] Query about calculating the monthly average of daily data columns

2019-09-13 Thread PIKAL Petr
From: R-help On Behalf Of Subhamitra > Patra > Sent: Friday, September 13, 2019 3:20 PM > To: Jim Lemon ; r-help mailing list project.org> > Subject: Re: [R] Query about calculating the monthly average of daily data > columns > > Dear Sir, > > Yes, I understood the

Re: [R] Query about calculating the monthly average of daily data columns

2019-09-13 Thread Subhamitra Patra
Dear Sir, Yes, I understood the logic. But, still, I have a few queries that I mentioned below your answers. "# if you only have to get the monthly averages, it can be done this way > spdat$month<-sapply(strsplit(spdat$dates,"-"),"["*,2*) > spdat$year<-sapply(strsplit(spdat$dates,"-"),"[",*3*)" >

Re: [R] Query about calculating the monthly average of daily data columns

2019-09-13 Thread Jim Lemon
Hi Subhamitra, I'll try to write my answers adjacent to your questions below. On Fri, Sep 13, 2019 at 6:08 PM Subhamitra Patra wrote: > Dear Sir, > > Thank you very much for your suggestion. > > Yes, your suggested code worked. But, actually, I have data from 3rd > January 1994 to 3rd August 201

Re: [R] Query about calculating the monthly average of daily data columns

2019-09-13 Thread PIKAL Petr
returnB 24.26667 4 02.1994 returnB 30.03571 Cheers Petr > -Original Message- > From: R-help On Behalf Of Subhamitra > Patra > Sent: Friday, September 13, 2019 10:08 AM > To: Jim Lemon > Cc: r-help mailing list > Subject: Re: [R] Query about calculating the monthly

Re: [R] Query about calculating the monthly average of daily data columns

2019-09-13 Thread Subhamitra Patra
Dear Sir, Thank you very much for your suggestion. Yes, your suggested code worked. But, actually, I have data from 3rd January 1994 to 3rd August 2017 for very large (i.e. for 84 countries) sample. From this, I have given the example of the years up to 2000. Before applying the same code for the

Re: [R] Query about calculating the monthly average of daily data columns

2019-09-12 Thread Jim Lemon
Hi Subhamitra, Your data didn't make it through, so I guess the first thing is to guess what it looks like. Here's a try at just January and February of 1994 so that we can see the result on the screen. The logic will work just as well for the whole seven years. # create fake data for the first tw

Re: [R] Query about calculating the monthly average of daily data columns

2019-09-12 Thread Rui Barradas
Hello, Inline. Às 17:33 de 12/09/19, Bert Gunter escreveu: But she wants *monthly* averages, Rui. Thanks, my mistake. Ergo ave() or tidyData equivalent, right? Maybe. But ave() returns as many values as the input length, this seems more suited for tapply or aggregate. I will first cre

Re: [R] Query about calculating the monthly average of daily data columns

2019-09-12 Thread Rui Barradas
Hello, Please include data, say dput(head(data, 20)) # post the output of this But, is the problem as simple as rowMeans(data[2:3], na.rm = TRUE) ? Hope this helps, Rui Barradas Às 15:53 de 12/09/19, Subhamitra Patra escreveu: Dear R-users, I have daily data from 03-01-1994 to 29-12-2

Re: [R] Query about calculating the monthly average of daily data columns

2019-09-12 Thread Bert Gunter
No reproducible example, so hard to say. What class is your "date" column? -- factor, character, Date? See ?Date Once you have an object of appropriate class -- see ?format.Date -- ?months can extract the month and ?ave can do your averaging. No explicit looping is needed. The tidydata alternativ

[R] Query about calculating the monthly average of daily data columns

2019-09-12 Thread Subhamitra Patra
Dear R-users, I have daily data from 03-01-1994 to 29-12-2000. In my datafile, he first column is date and the second and third columns are the returns of the country A, and B. Here, the date column is same for both countries. I want to calculate the monthly average of both country's returns by us

Re: [R] Query on R-squared correlation coefficient for linear regression through origin

2018-09-27 Thread Rui Barradas
Hello, As for R^2 in Excel for models without an intercept, maybe the following are relevant. https://support.microsoft.com/en-us/help/829249/you-will-receive-an-incorrect-r-squared-value-in-the-chart-tool-in-exc https://stat.ethz.ch/pipermail/r-help/2012-July/318347.html Hope this helps,

Re: [R] Query on R-squared correlation coefficient for linear regression through origin

2018-09-27 Thread peter dalgaard
This is an old discussion. The thing that R is doing is to compare the model to the model without any regressors, which in the no-intercept case is the constant zero. Otherwise, you would be comparing non-nested models and the R^2 would not satisfy the property of being between 0 and 1. A simi

Re: [R] Query on R-squared correlation coefficient for linear regression through origin

2018-09-27 Thread Eric Berger
See also this thread in stats.stackexchange https://stats.stackexchange.com/questions/26176/removal-of-statistically-significant-intercept-term-increases-r2-in-linear-mo On Thu, Sep 27, 2018 at 3:43 PM, J C Nash wrote: > This issue that traces back to the very unfortunate use > of R-squared a

Re: [R] Query on R-squared correlation coefficient for linear regression through origin

2018-09-27 Thread J C Nash
This issue that traces back to the very unfortunate use of R-squared as the name of a tool to simply compare a model to the model that is a single number (the mean). The mean can be shown to be the optimal choice for a model that is a single number, so it makes sense to try to do better. The OP ha

[R] Query on R-squared correlation coefficient for linear regression through origin

2018-09-27 Thread Patrick Barrie
I have a query on the R-squared correlation coefficient for linear regression through the origin. The general expression for R-squared in regression (whether linear or non-linear) is R-squared = 1 - sum(y-ypredicted)^2 / sum(y-ybar)^2 However, the lm function within R does not seem to use this

Re: [R] Query on read.xls function in gdata

2018-09-06 Thread PIKAL Petr
ver is easiest and most convenient to you. Cheers Petr From: Aakash Kumar Sent: Thursday, September 6, 2018 2:48 PM To: PIKAL Petr ; r-help@r-project.org Subject: RE: [R] Query on read.xls function in gdata Thanks for the suggestion, Petr. I did try using read_xls and read_excel functions,

Re: [R] Query on read.xls function in gdata

2018-09-06 Thread Jeff Newmiller
Without a reproducible example that is highly unlikely to happen. However, you might just want to try the openxlsx or readxl packages instead. On September 6, 2018 3:43:05 AM PDT, Aakash Kumar wrote: >Hi Team, > >I am trying to read in .xls files in R using read.xls function present >in >gdata p

Re: [R] Query on read.xls function in gdata

2018-09-06 Thread PIKAL Petr
lp On Behalf Of Aakash Kumar > Sent: Thursday, September 6, 2018 12:43 PM > To: r-help@r-project.org > Subject: [R] Query on read.xls function in gdata > > Hi Team, > > I am trying to read in .xls files in R using read.xls function present in > gdata > package. I have install

[R] Query on read.xls function in gdata

2018-09-06 Thread Aakash Kumar
Hi Team, I am trying to read in .xls files in R using read.xls function present in gdata package. I have installed the required perl dependencies as well. Yet, I am facing the following error. "*Error in xls2sep : Intermediate file is missing*" Could someone please help me out understanding the

Re: [R] Query on convergence

2018-07-25 Thread PIKAL Petr
nasio...@ynu.jp > Sent: Wednesday, July 25, 2018 1:22 PM > To: r-help@r-project.org > Subject: [R] Query on convergence > > Hello, > > > > Is there somebody who can demonstrate how to code a while loop that ends > when a convergence between the values of two or more va

[R] Query on convergence

2018-07-25 Thread tembe-atanasio...@ynu.jp
Hello, Is there somebody who can demonstrate how to code a while loop that ends when a convergence between the values of two or more variables (say vectors) is reached? Thank you Regards [[alternative HTML version deleted]] __ R-help@r-pr

Re: [R] Query on while loop

2018-07-20 Thread Bert Gunter
I don't know how to say this charitably, but your post indicates that you **really need to go through an R tutorial or two.** Rather than give you answers to these very basic matters, a couple of hints: 1. A and P are vectors with 3 elements, not matrices . 2. I presume things like c11 and c32 a

[R] Query on while loop

2018-07-20 Thread Atanasio Alberto Tembe Tembe
Hello, I have two matrices: a<-matrix(c(100,350,100,240,150,210,60,120,200 ),3,3) and c<-matrix(c(2,9,13,10,4,11,14,12,3),3,3). I have also defined the following variables: K=0 A[i,j]=colSums(a) P[i,j]=rowSums(a) F[i,j]=c[i,j]^(-2 ) Using these data I want to perform the calculation which must

Re: [R] Query regarding simulating weibull aft model with predefined censoring rate

2018-07-18 Thread Bert Gunter
Off topic for r-help (see posting guide linked below). Suggest Posting on stats.stackexchange.com instead.. Cheers, Bert Bert Gunter "The trouble with having an open mind is that people keep coming along and sticking things into it." -- Opus (aka Berkeley Breathed in his "Bloom County" comic

[R] Query regarding simulating weibull aft model with predefined censoring rate

2018-07-18 Thread Fabiha Binte Farooq
Hi there, I am an MS student from Bangladesh. I am doing thesis in my MS degree. In my research, I am generating data from weibull distribution and my model is accelerated failure time (AFT) model. I am considering right censoring as well as covariates. Now I have been facing difficulties to genera

[R] Query on the Arimax modeling results

2018-05-25 Thread Sanchi Bhatia
Hi R team, We’ve run Arimax models in R. We had a lot of queries around the interpretation of the outputs. *Dependent variable =* Volume (Growth %) *Independent Variables =* 3 Macroeconomic variables (Growth %) Following is the line of code Arimax.Model <- auto.arima(y = input.data[,"V

Re: [R] Query - Merging and conditional replacement of values in a data frame

2017-02-13 Thread MacQueen, Don
How about this? foo <- merge(df1, df2, all=TRUE) is.new <- !is.na(foo$v11) foo$v1[is.new] <- foo$v11[is.new] foo <- foo[, names(df1)] > foo time v1 v2 v3 11 2 3 4 22 5 6 4 33 112 3 4 44 112 3 4 55 2 3 4 66 2 3 4 -- Don MacQueen Lawrence Livermo

Re: [R] Query - Merging and conditional replacement of values in a data frame

2017-02-12 Thread Bhaskar Mitra
Thanks for all your help. This is helpful. Best, Bhaskar On Sun, Feb 12, 2017 at 4:35 AM, Jim Lemon wrote: > Hi Bhaskar, > Maybe: > > df1 <-read.table(text="time v1 v2 v3 > 1 2 3 4 > 2 5 6 4 > 3 1 3 4 > 4 1 3 4 > 5 2 3 4 > 6 2 3 4", > header=TRUE) > >

Re: [R] Query - Merging and conditional replacement of values in a data frame

2017-02-12 Thread Jim Lemon
Hi Bhaskar, Maybe: df1 <-read.table(text="time v1 v2 v3 1 2 3 4 2 5 6 4 3 1 3 4 4 1 3 4 5 2 3 4 6 2 3 4", header=TRUE) df2 <-read.table(text="time v11 v12 v13 3 112 3 4 4 112 3 4", header=TRUE) for(time1 in df1$time) { time2<-which(df2$

Re: [R] Query - Merging and conditional replacement of values in a data frame

2017-02-11 Thread Jeff Newmiller
Or use rownames and subscripting? df1 <- read.table( text= "time v1 v2 v3 1 2 3 4 2 5 6 4 3 1 3 4 4 1 3 4 5 2 3 4 6 2 3 4 ",header=TRUE) df2 <- read.table( text= "time v11 v12 v13 3 112 3 4 4 112 3 4 ",header=TRUE) df3 <- df1 rownames( d

Re: [R] Query - Merging and conditional replacement of values in a data frame

2017-02-11 Thread Bert Gunter
Your "assignments" (<-) are not legitimate R code that can be cut and pasted. Learn to use dput() to provide examples that we can use. You fail to say whether the time column of df2 is a proper subset of df1 or may contain times not in df1. I shall assume the latter. You also did not say whether t

[R] Query - Merging and conditional replacement of values in a data frame

2017-02-11 Thread Bhaskar Mitra
Hello Everyone, I have two data frames df1 and df2 as shown below. They are of different length. However, they have one common column - time. df1 <- time v1 v2 v3 1 2 3 4 2 5 6 4 3 1 3 4 4 1 3 4 5 2 3 4 6 2 3 4 df2 <- time v11 v12 v13 3 112 3 4

Re: [R] Query regarding Approximate/Fuzzy matching & String Extraction(numeric) in R

2016-09-24 Thread Bert Gunter
"So I want a **Fuzzy logic approach** to..." That is a near meaningless buzzword. I suggest you search on "fuzzy logic" on the rseek.org website and see if any of the hits there does whatever it is that you have in mind. Cheers, Bert Bert Gunter "The trouble with having an open mind is that

Re: [R] Query regarding Approximate/Fuzzy matching & String Extraction(numeric) in R

2016-09-24 Thread David Winsemius
> On Sep 24, 2016, at 11:49 AM, Aarushi Kaushal > wrote: > > Hey there, > > I work for an organisation named Bullero Capital Pvt. Ltd. in New Delhi, > which is involved in financial services, Portfolio management to be > precise. Recently we've started creating ourselves a database using R for

[R] Query regarding Approximate/Fuzzy matching & String Extraction(numeric) in R

2016-09-24 Thread Aarushi Kaushal
Hey there, I work for an organisation named Bullero Capital Pvt. Ltd. in New Delhi, which is involved in financial services, Portfolio management to be precise. Recently we've started creating ourselves a database using R for all the stocks etc. to be automated and hence analyzed accordingly for f

Re: [R] Query on the R of free soft version 3

2016-09-21 Thread John Kane
What is your operating system? Please do not post in HTML. John Kane Kingston ON Canada > -Original Message- > From: kkam-...@echigo.ne.jp > Sent: Wed, 21 Sep 2016 09:30:15 +0900 > To: r-help@r-project.org > Subject: [R] Query on the R of free soft vers

Re: [R] Query on the R of free soft version 3

2016-09-21 Thread PIKAL Petr
Hi > -Original Message- > From: R-help [mailto:r-help-boun...@r-project.org] On Behalf Of Kamin > Kyuji > Sent: Wednesday, September 21, 2016 2:30 AM > To: R-help@r-project.org > Subject: [R] Query on the R of free soft version 3 > > Dear > > > > Altho

Re: [R] Query on the R of free soft version 3

2016-09-21 Thread David Winsemius
> On Sep 20, 2016, at 5:30 PM, Kamin Kyuji wrote: > > Dear > > > > Although I can install the new version of the R, I can not open the soft. > > > > How do I do it? Surely you will need to tell us more than that. This just tells us you are having problems but nothing else. > > > > K

[R] Query on the R of free soft version 3

2016-09-20 Thread Kamin Kyuji
Dear Although I can install the new version of the R, I can not open the soft. How do I do it? Kyuzi Kamoi, MD. [[alternative HTML version deleted]] __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.e

Re: [R] Query to find minimum value in a matrix in R

2016-09-16 Thread PIKAL Petr
0), .Dim = c(4L, 4L), .Dimnames = list(NULL, c("col1", "col2", "col3", "col4"))) min.upper(mat) [1] 5 1 2 Cheers Petr > -Original Message- > From: R-help [mailto:r-help-boun...@r-project.org] On Behalf Of susmita T > Sent: Friday, September

Re: [R] Query to find minimum value in a matrix in R

2016-09-16 Thread S Ellison
ention to the meaning of negative indices (like '-n' in dd[-n,]) S Ellison > -Original Message- > From: R-help [mailto:r-help-boun...@r-project.org] On Behalf Of susmita T > Sent: 16 September 2016 13:09 > To: r-help@r-project.org > Subject: [R] Query to find

[R] Query to find minimum value in a matrix in R

2016-09-16 Thread susmita T
Hi, Good Morning! I am new to R and finding difficulty in understanding the code. Since few days I am stuck at single line of code which I am unable to understand. Though there may be number of logics to find min value. As a new beginner I am following a book and as it has the following code mi

Re: [R] Query about Text Preprocessing (Encoding)

2016-05-29 Thread Duncan Murdoch
On 29/05/2016 3:20 AM, Khadija Shakeel wrote: i want to work with Urdu language but R is only displaying Urdu text but cant work with Urdu text. Actually I want to apply preproessing steps of text mining. but R is nor responding for this text. Help me how can I handle this problem? here are some

[R] Query about Text Preprocessing (Encoding)

2016-05-29 Thread Khadija Shakeel
i want to work with Urdu language but R is only displaying Urdu text but cant work with Urdu text. Actually I want to apply preproessing steps of text mining. but R is nor responding for this text. Help me how can I handle this problem? here are some pictures of word cloud of Urdu text. -- Khadi

Re: [R] Query about use of format in strptime

2016-04-11 Thread MacQueen, Don
;. >I am not able to create a sequence of class "POSIXlt" "POSIXt", in order >to merge the two data frames. > >Could you please help me in this? >Thank you again for your attention >Stefano > > > >Da: Jim Lemon

Re: [R] Query about use of format in strptime

2016-04-11 Thread David Winsemius
s in them and now you want no dashes. Make up our mind: init_day="20071119" fin_day="20071121". df_new <- data.frame(data_strptime=seq(as.POSIXct(init_day, %Y%M%D%H%M"), as.POSIXct(fin_day, %Y%M%D%H%M"), by="

Re: [R] Query about use of format in strptime

2016-04-11 Thread Stefano Sofia
__ Da: Jim Lemon [drjimle...@gmail.com] Inviato: lunedĂŹ 11 aprile 2016 9.47 A: Stefano Sofia Cc: r-help@r-project.org Oggetto: Re: [R] Query about use of format in strptime Hi Stefano, As the help page says: "The default for the format methods is "%Y-%m-%d %H:%M:%S" if a

  1   2   3   >