[R] Identifying Gender

2016-12-01 Thread Saba Sehrish via R-help
Hi I have a csv file of Names based on male and female managers. Is there some code in R to identify the gender by names? ThanksSaba [[alternative HTML version deleted]] __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https

[R] Replacing value with "1"

2016-09-22 Thread Saba Sehrish via R-help
uot;. Please see below as a sample: >df 00100 NA0110 0100NA What I want is: 00110 NA0111 0110NA I shall be thankful for the reply. Saba

[R] Install GARPFRM package

2016-05-18 Thread Saba Sehrish via R-help
Hi If a package is not loading, it is a matter of concern. Therefore, I have asked for the assistance or guidance in this regards. Saba __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help

[R] Install GARPFRM package

2016-05-18 Thread Saba Sehrish via R-help
ge ‘GARPFRM’ had non-zero exit status (b) library(GARPFRM) It gives following error : Error in library(GARPFRM) : there is no package called ‘GARPFRM’ Please help me in this regard. Thanks Saba __ R-help@r-project.org mailing list -- To UNSUBSCRIB

[R] replacing values of rows with identical row names in two dataframes

2016-05-06 Thread Saba Sehrish via R-help
150 160 20040315 NA NA 180 190 200 20040331 NA 145 160 175 180 If it is possible, I would prefer to use "for loop" and "which" function to achieve the result. Please guide me in this regard. Thanks Saba ___

[R] Inserting a blank row to every other row

2016-04-24 Thread Saba Sehrish via R-help
Hi I need to insert a blank row after every row in R data frame. I have achieved it through: df[rep(1:nrow(df),1,each=2),] But it inserts a row with name of previous row, while i want a complete blank row without any name/title. Please guide me Regards Saba

[R] Dividing rows in groups

2016-04-23 Thread Saba Sehrish via R-help
40 1 41 0 50.22 1 50.78 NA Kindly guide me in this regard. Thanks Saba __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide

[R] multiplication by groups

2016-04-23 Thread Saba Sehrish via R-help
01 4 10 5 0.22 1 5 0.78NA Kindly guide me in this regard. Thanks Saba __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the

Re: [R] Finding Highest value in groups

2016-04-23 Thread Saba Sehrish via R-help
Thanks a lot. Its really helpful Regards Saba On Saturday, 23 April 2016, 6:50, Giorgio Garziano wrote: Since the aggregate S3 method for class formula already has got na.action = na.omit, ## S3 method for class 'formula' aggregate(formula, data, FUN, ..., subset,

[R] Finding Highest value in groups

2016-04-22 Thread Saba Sehrish via R-help
me in this regard. Thanks Saba __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self

[R] working with unequal rows

2016-04-10 Thread Saba Sehrish via R-help
. Thanks Saba __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained

[R] unbalanced number of rows

2016-04-10 Thread Saba Sehrish via R-help
HiI have a data frame with rows specifying companies (codes are assigned to companies) and columns specify months (monthly data). The data is based on male (M) and female (F) information for each month. Following is an example of how data looks like: 01 02 03 04001 na M M M001 M M M F002 M F F

[R] Descriptive Statistics of time series data

2016-04-06 Thread Saba Sehrish via R-help
gives values for one month of a particular year (e.g. March 31st, 2010). Right now R gives descriptive results for each column, whereas I need it collectively for all the years ( one mean, one sd, one min, one max and one median) for each variable. Kindly guide me in this regard. Thanks. Saba

Re: [R] error in vcovNW

2015-12-19 Thread Saba Sehrish via R-help
Hi Thanks for the reminder. Actually I want to analyse whether present value of variable A is Granger caused by lag values of B and test linear hypothesis "B1,B2,B3,B4,B5=0". Therefore, to get robust standard error NeweyWest estimates are applied. Saba On Saturday, 19 December 2

Re: [R] error in vcovNW

2015-12-18 Thread Saba Sehrish via R-help
Thank you. The issue is resolved by scaling the data in millions. Saba On Saturday, 19 December 2015, 15:06, Achim Zeileis wrote: On Sat, 19 Dec 2015, Saba Sehrish via R-help wrote: > Hi I am using NeweyWest standard errors to correct lm( ) output. For example: > lm(A~A1+A2+A3

[R] error in vcovNW

2015-12-18 Thread Saba Sehrish via R-help
Hi I am using NeweyWest standard errors to correct lm( ) output. For example: lm(A~A1+A2+A3+A4+A5+B1+B2+B3+B4+B5) vcovNW<-NeweyWest(lm(A~A1+A2+A3+A4+A5+B1+B2+B3+B4+B5)) I am using package(sandwich) for NeweyWest. Now when I run this command, it gives following error: Error in solve.default(diag(n

[R] Error-linear regression

2015-12-17 Thread Saba Sehrish via R-help
<-nrow(B)  B1<-matrix(NA,nrow,1)  B2<-matrix(NA,nrow,1) B3<-matrix(NA,nrow,1) B4<-matrix(NA,nrow,1) B5<-matrix(NA,nrow,1) B1[2:nrow,1]<-B[1:(nrow-1),1]  B2[3:nrow,1]<-B[1:(nrow-2),1] B3[4:nrow,1]<-B[1:(nrow-3),1]  B4[5:nrow,1]<-B[1:(nrow-4),1] B5[6:nrow,1]<-B[1

Re: [R] Error in linear regression

2015-12-17 Thread Saba Sehrish via R-help
(B~B1+B2+B3+B4+B5+A1+A2+A3+A4+A5) Following error is occurring: Error in lm.fit(x,y,offset = offset, singular.ok = singular.ok, ...) :  NA/NaN/lnf in 'y'In addition: Warning message:In model.response(mf,"numeric") : NAs introduced by coercion RegardsSaba On Friday, 18 Decemb

[R] Error in linear regression

2015-12-17 Thread Saba Sehrish via R-help
1)B2<-matrix(NA,nrow,1)B3<-matrix(NA,nrow,1)B4<-matrix(NA,nrow,1)B5<-matrix(NA,nrow,1)B1[2:nrow,1]<-B[1:(nrow-1),1]B2[3:nrow,1]<-B[1:(nrow-2),1]B3[4:nrow,1]<-B[1:(nrow-3),1]B4[5:nrow,1]<-B[1:(nrow-4),1]B5[6:nrow,1]<-B[1:(nrow-5),1] reg1<-lm(A~A1+A2+A3+A

[R] For loop coding

2015-12-04 Thread Saba Sehrish via R-help
Hi I will be grateful if someone please tell me the programming to run regression on time series data through "For Loop". Regards. Saba Sent from Yahoo Mail on Android [[alternative HTML version deleted]] __ R-help@r-project.o

[R] R-help mailing list

2015-12-03 Thread Saba Sehrish via R-help
l Stock 15, one after another.                    c)  As the the process will have to be repeated, therefore instead of manual coding everytime, “For Loop” is required.    I shall bereally grateful for a detailed reply.   Thanks.   Regards Saba Sehrish [[alternative HTML versi

[R] problem with nested loops

2013-02-26 Thread Richard Saba
",Names[i],",k=-1) + lag(",Names[i],",k=-2)+ lag(",Names[1],",k=-1) +lag(",Names[1],",k=-2)")) form2<-as.formula(paste(Names[1],"~fitted(reg1)")) # reg1 <-dynlm(form1,data=Dnames[j]) # reg2 <-dynlm(form2,data=Dname

[R] vars impulse response function output

2011-11-07 Thread Richard Saba
Sorry about first post. This is in plain text. Does anyone know if the bootstrap CI intervals generated by the irf() function (impulse response function) in the " vars" package are bias corrected? Thanks, Richard Saba __ R-help@r-p

[R] vars impulse responce function output

2011-11-07 Thread Richard Saba
Does anyone know if the bootstrap CI intervals generated by the irf() function (impulse response function) in the " vars" package are bias corrected? Thanks, Richard Saba [[alternative HTML version deleted]] __ R-help@r-project.o

[R] Read variable column width data

2011-08-15 Thread R Saba
,538,000 153,449,000 154,767,000 140,129,000 140,028,000 139,882,000 14,409,000 13,421,000 14,885,000 9.3% 8.7% 9.6% Thanks, Richard Saba -- View this message in context: http://r.789695.n4.nabble.com/Read-variable-column-width-data-tp3744922p3744922.html Sent from the R help mailing list a

[R] Count objects and print it into a new variable

2011-06-13 Thread saba
Hello, I used R a year ago. With the data I am working with now, I realized that I need to go back to R. Unfortunately, my memory is not my friend if it comes down to coding :-) What I want to do is extract the length of a variable of a file with certain conditions and then print this number in a

[R] copy values from one dataframes into another

2011-02-23 Thread saba
Hello everyone, I have the following problem, I have a dataframes that looks like this: fire$Year fire$Size 1 19811738.0 2 19842228.1 3 1985 38963.3 4 19862223.4 5 19873594.6 6 19881520.0 ... What I would like to do is copy the values from t

Re: [R] Calculate a mean for several months for several years

2011-02-22 Thread saba
Thank you so much for your help Dennis, Pete and D Kelly! In the meantime I tried to do a loop and came up with this: l<-0 for (i in 0:((length(lakewil$Year)/12)-1)) { l[i+1]<- mean(lakewil$MeanTemp[((i*12)+7):((i*12)+9)]) } print(l) This gives me the summer averages over the 3 months for each

[R] Calculate a mean for several months for several years

2011-02-21 Thread saba
Hello everyone, I have a dataset with 3 colums (Year, Month, MeanTemp). Now I would like to calculate the average of the mean temperature for the summer months (Juli, August, September) for each of the 20 years. I'm sure it's somehow possible with a loop, but all I tried so far didn't worked and

[R] reshape panel data

2010-04-08 Thread Richard Saba
nel series identifying the ID and TIME index variables. Then use the time-series fill command. I have searched the help and vignettes of both the "zoo" and "plm" packages but cannot find the solution. Can anyone help? Thanks, Richard Saba _

[R] Reading hierarchical data

2010-02-07 Thread Saba(Home)
ervation per person, and the with family information repeated for people in the same family. Can anyone help? Thanks, Richard Saba __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://

[R] Overriding contributed package functions

2009-03-05 Thread Richard Saba
tsdiag(model1) stats::tsdiag(model1) detach("package:TSA") tsdiag(model1) R Saba __ 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.html and provide commented, minimal, self-contained, reproducible code.

[R] Bug? in summary( ) function base package

2008-04-30 Thread Richard Saba
6 7717 7461 7767 7925 8623 8945 10078 9179 8037 8488 7874 8647 1977 7792 6957 7726 8106 8890 9299 10625 9302 8314 8850 8265 8796 1978 7836 6892 7791 8192 9115 9434 10484 9827 9110 9070 8633 9240 > dat1<-as.data.frame(USAccDeaths) > summary(dat1) x

[R] convert weekly time series data to monthly

2008-03-30 Thread Richard Saba
be appreciated. Thanks, Richard Saba Department of Economics Auburn University Email: [EMAIL PROTECTED] Phone: 334 844-2922 __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R

[R] tseries(arma) vs. stats(arima)

2008-03-21 Thread Richard Saba
le utilizing the "xreg" argument available in the other arima functions . Thanks, Richard Saba [EMAIL PROTECTED] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-p

[R] Formulae for R functions

2008-02-12 Thread Richard Saba
without success. For example I have attempted to replicate by hand the se.fit calculation from a lm object calculated by a call to the predict function and have not been able to reproduce the results. Thanks, Richard Saba Department of Economics Auburn University Email: [EMAIL PROTECTED

Re: [R] question about xreg of arima

2008-01-12 Thread Richard Saba
a, and why it works as it does? >Thanks! -- >Tom Richard Saba Department of Economics Auburn University Auburn, AL 36849 USA [EMAIL PROTECTED] [[alternative HTML version deleted]] __ R-help@r-project.org mailing list htt

[R] R procedure similar to STATA heckprob?

2008-01-03 Thread Richard Saba
Is anyone aware of an R procedure similar to STATA's "heckprob" procedure? "Heckprob" fits maximum likelihood probit models correcting for sample selection bias. Thanks, Richard Saba Department of Economics Auburn University

[R] Working with "ts" objects

2007-12-05 Thread Richard Saba
jects? I found the Shumway "Time series analysis and its applications with R Examples" website very helpful but many practical questions involving manipulation of time series data still remain. Any help will be appreciated. Thanks, Richard Saba Department of Economics Auburn University

[R] extracting year an month from ts data set

2007-11-27 Thread Richard Saba
mmy variables for each month. If I had a variable which take values from 1 to 12 indicating the month I could use the factor() function to model the series. reg1<-lm(hstarts~ -1 + factor(months)) Is there a function that will extract the year and month from a ts data set? Thanks, Richar

[R] Newey-West and SUR regression models

2007-10-26 Thread Richard Saba
Is anyone aware of a procedure to apply Newey-West corrections for autocorrelation to a SUR regression model? The SANDWICH package seems to be applicable only to LM or GLM models. Thanks, Richard Saba Department of Economics Auburn University Email: [EMAIL PROTECTED

[R] Newey-West corrections in SUR regression models

2007-10-16 Thread Richard Saba
Is anyone aware of a procedure to apply Newey-West corrections for autocorrelation to a SUR regression model? The SANDWICH package seems to be applicable only to LM or GLM models. Thanks, Richard Saba Department of Economics Auburn University Email: [EMAIL PROTECTED