[R] Packages Not Available for R version 4.0.3

2020-10-23 Thread Charles Thuo
I have attempted to install the packages Rtools and rgrs but the install.packages command yields a message that the same are not available for R version 4.0. How do i get around this as i need the said packages to implement some credit scoring GLMs using the " rgrs" package. With Regards, Char

[R] Fitting Mixed Distributions in the fitdistrplus package

2020-10-21 Thread Charles Thuo
Dear Sirs, The below listed code fits a gamma and a pareto distribution to a data set danishuni. However the distributions are not appropriate to fit both tails of the data set hence a mixed distribution is required which has ben defined as "mixgampar" as shown below. library(fitdistrplus) x<-

[R] how to add a calculated column into a data frame

2020-06-04 Thread Charles Thuo
Dear Sirs, I have a data frame that has a column that shows the transaction date. How do i add another column that extracts the year of transaction from the transaction date. Charles [[alternative HTML version deleted]] __ R-help@r-project.

[R] Which GLM to use with mixed predictor variables i.e. both discrete and continous

2016-01-09 Thread Charles Thuo
I have the following glm v_glm <- glm(claim_count~ave_age+cost+inc.count+p.statcount,data=v,family=poisson) claim_count - dependent variable and is discrete ave_age - predictor variable and is continuous cost - predictor variable and is continuous inc_count - predictor variable and is discret

[R] Removing rows in a data frame

2015-07-02 Thread Charles Thuo
I have a data frame whose rows are 678013 . I would like to remove rows from 30696 to 678013 and then attach a new column with a length of 30595. I tried Y<- X[-30595:678013,] and its not working In addition how do i add a new column Kindly assist. Charles [[alternative HTML version

[R] How to run a glm using one factor in a dichotomous categorical variable

2015-06-30 Thread Charles Thuo
am running a glm to model the number of accidents that result from diesel or petrol cars. How can i run a glm that on only one factor i.e. diesel only. require(CASdatasets) data(freMTPL2freq) CONTRACTS<- data.frame(freMTPL2freq$IDpol,freMTPL2freq$ClaimNb,freMTPL2freq$Exposure,freMTPL2freq$V

[R] running the aggregate claims distribution using the package "actuar"

2014-10-22 Thread Charles Thuo
# i run the following after fitting claims data into the negative binomial as the frequency distribution and the lognormal for the severity distribution using the package "fitdistrplus". require(actuar) fx<- discretize(plnorm(x,11.69,0.79331),method="unbiased",step=500,from=0, to=qln

[R] packages across different versions of R

2014-07-21 Thread Charles Thuo
I have just installed R 3.1.1 in a machine where R 3.0.1 is already installed. Is it possible to use packages in the 3.0.1 on the 3.1.1. version as the same are in a single workstation. Charles [[alternative HTML version deleted]] __ R-help@

[R] how to decompose a daily time series

2014-06-18 Thread Charles Thuo
# I have a daily series of count of transactions data i want to decompose and forecast. d<-c(723, 772, 967, 897, 621, 684, 722, 764, 856, 819, 678, 708, 698, 832, 928, 834, 649, 676, 635, 729, 778, 817, 616, 598, 605, 851, 822, 791, 678, 703, 716, 834, 872, 831, 641, 610, 699, 840, 901, 789, 620,

[R] How to create a time series from a data set where some days are skipped

2014-05-21 Thread Charles Thuo
I have a data set with daily claim numbers. I group with monthly totals and create a time series as follows v.ts<- ts(v, start=2008,frequency=12) How can the daily data be converted into a time series where there is no claim number for sundays and public holidays. Charles. [[alternati

[R] fitting a bivariate model using the copula package

2014-03-11 Thread Charles Thuo
require(copula) # I specify the copula gmb<-gumbelCopula(4,dim=2) # The bivariate CDF is generated myCDF<-mvdc(gmb,margins=c("lnorm","nbinom"),paramMargins=list(list(meanlog=11.69,sdlog=0.7781),list(mu=16,size=2.6))) # A random sample of the bivariate risk data is generated as a matrix. Th

[R] package opVar

2014-03-08 Thread Charles Thuo
Hello, I was attempting to install the package opVAr and got the following message Warning message: package '' is not available (for R version 3.0.2) Is this package available at all. [[alternative HTML version deleted]] __ R-help@r-project.

[R] fitting the lognormal and binomial into a gumbel copula

2014-03-08 Thread Charles Thuo
require(copula) # I specify the copula gmb<-gumbelCopula(4,dim=2) # The bivariate CDF is generated myCDF<-mvdc(gmb,margins=c("lnorm","nbinom"),paramMargins=list(list(meanlog=11.69,sdlog=0.7781),list(mu=16,size=2.6))) # A random sample of the bivariate risk data is generated as a matrix. Th

[R] fitting the lognormal and negative binomial into a gumble copula

2014-03-06 Thread Charles Thuo
# I define a bivariate copula composed of 2 marginals each with 2 parameters gmb<-gumbelCopula(4,dim=2) # Idefine the bivariate CDF specifying the already fitted parameters from the log normal and negative binomial myCDF<-mvdc(gmb,margins=c("lnorm","nbinom"),paramMargins=list(list(meanlog=11.6

[R] fitting a time series into a GARCH model using fGarch

2014-02-24 Thread Charles Thuo
I have been trying to fit a time series object using the garchFit() function. However am getting the results below > class(v.ts) [1] "ts" fit=garchFit(v.ts) Error in if (allVarsTest != 1) { : missing value where TRUE/FALSE needed I do not understand the error. Which missing value is required. K

[R] How to determine the order of a time series object

2014-01-10 Thread Charles Thuo
I have monthly claims data from 2009 to end of 2013 and would like to forecast for 2014. How is this done in R. Charles. [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLE

[R] Which R version is the package "ts" available for.

2013-12-29 Thread Charles Thuo
I was attempting to install the ts package for time series analysis but got the following message. Warning message: package ‘’ is not available (for R version 3.0.2) Charles. [[alternative HTML version deleted]] __ R-help@r-project.org maili

[R] how to link different versions of R

2013-12-05 Thread Charles Thuo
Hi, I had downloaded the package zoo under R version 3.0.0. Afterwards i downloaded R version 3.0.2 on the same workstation. Is it possible to use the zoo package from 3.0.0. in 3.0.2. Is is possible to upgrade from version 3.0.1 to 3.0.2 for example without downloading afresh and retain the

[R] purpose of the set.seed(function)

2013-12-03 Thread Charles Thuo
what is the purpose of the subject function Charles [[alternative HTML version deleted]] __ 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/posting-guide.h

[R] fitting a random gamma sample into the weibull distribution

2013-10-19 Thread Charles Thuo
> require(MASS) > n<- 10 > n [1] 1e+05 > w<- rgamma(n,rate=0.5,shape=5);head(w) [1] 14.135679 18.839336 6.623502 17.165505 2.847572 7.511726 > fit.w<- fitdistr(w,"weibull") Warning messages: 1: In densfun(x, parm[1], parm[2], ...) : NaNs produced 2: In densfun(x, parm[1], parm[2], ...) : NaN

[R] How to establish the order of a time series so as to fit ARIMA

2013-10-05 Thread Charles Thuo
I have sales data for years 2011, 2012 and upto september 2013. I have applied the decompose function to filter the trend , seasonal and random component. however i would like to apply the predict function to forecast the sales for the rest of year and into 2014. How can i establish the order of t

[R] transferring a graph from R into word

2013-10-01 Thread Charles Thuo
I have been copying graphs as bitmap image from R by right clicking on them and pasting on word. However this does not seem to be working any more. Is there another way. Charles [[alternative HTML version deleted]] __ R-help@r-project.org mail

[R] is it possible to install R packages without admin rights on a work station

2013-09-16 Thread Charles Thuo
How can a person in a controlled environment install additional R packages.. Charles. [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http:

[R] how to retain dimnames while exporting from excel into r

2013-09-12 Thread Charles Thuo
v<- read.csv(file="sales.csv",header=TRUE) v i get an output whose column names are V1,V2, and so on but i would like to retain the original column names such as january through to december. Charles. [[alternative HTML version deleted]] __

[R] how to convert a list into a data frame.

2013-09-11 Thread Charles Thuo
After reading a data set from excel into R it is of the type list. How can such a list be converted into a data frame so as to attach the columns. Charles. [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.e

[R] how to read data from MSExcel into R

2013-09-11 Thread Charles Thuo
how can one read data from MSEXcel into R especially in a case where one does not have administrator rights to install additional packages. In short how to read data from MSExcel into R with base packages only. [[alternative HTML version deleted]] _

[R] "actuar" package query

2013-06-28 Thread Charles Thuo
I run the following: library(actuar) x <- seq(0, 22, 0.5) fl <- discretize(plnorm(x, 2.1), from = 0, to = 22, step = 0.5, method ="lower") Fs <- aggregateDist("recursive", model.freq = "poisson",model.sev = fl, lambda = 10, x.scale = 0.5) Warning message: In panjer(fx = model.sev, dist = dist, p0 =

[R] "actuar" package query.

2013-06-27 Thread Charles Thuo
I run the following in the "actuar" package while trying to discretize the lognormal distribution which i had fitted using the "fitdistrplus" package. fx <- discretize(plnorm(11.69,2.1),from = 0, to = 22, step = 0.5, method = "upper") Error in discretize(plnorm(11.69, 2.1), from = 0, to = 22, st