similar to: Reading a file in R

Displaying 20 results from an estimated 9000 matches similar to: "Reading a file in R"

2006 Sep 27
2
Constrained OLS regression
Hello R helpers, I am trying to do a linear OLS regression of y on two variables x1 and x2. I want to constrain the coefficients of x1 and x2 to sum up to 1. and therefore run a constrained OLS. Can anybody help with this? (I have seen some answers to similar questions but it was not clear to me what I need to do) - I have tried the lm function with offset but I must not have used it properly.
2006 Aug 28
1
Help on function adf.test
Hello everybody, I've got a matrix called EUROPEDATA and I want to calculate the adf test statistic (part of the tseries package) on a rolling basis for window my.win on each column; i.e. each column of EUROPEDATA represents a particular variable; for the first column I calculate the adf test statistic for window my.win = 60 for example, roll forward one observation, calculate the adf
2006 Oct 12
1
Variance Ratio test
Hello, I am looking for a code in R for the variance ratio test statistic (the Lo and Mackinlay version or any other versions). Does anybody have such a code they can share or know a library in which I can find this function? Basically I have a number of time series which I need to check for persistence. One other test I can use is the runs test in the tseries package. Any help will be greatly
2006 Jul 26
2
Codes; White's heteroscedasticity test and GARCH models
Hello, I have just recently started using R and was wondering whether anybody had a code written for White's heteroscedasticity correction for standard errors. Also, can anybody share a code for the GARCH(1,1) and GARCH-in-mean models for modelling regression residuals? Thanks a lot in advance, Spyros --------------------------------- [[alternative HTML version
2007 May 14
6
Conditional Sums for Index creation
Hi, Apologies for the long mail. I have a data.frame with columns of price/mcap data for a portfolio of stocks, and the date. To get the total value of the portfolio on a daily basis, I calculate rowSums of the data.frame. > set.seed(1) > ab <- matrix(round(runif(100)*100),nrow=20,ncol=5) > ab[1:5,4:5] <- NA > ab[6:10,5] <- NA > ac <- as.data.frame(ifelse(ab <=
2006 Sep 15
2
prediction interval for new value
Hi, 1. How do I construct 95% prediction interval for new x values, for example - x = 30000? 2. How do I construct 95% confidence interval? my dataframe is as follows : >dt structure(list(y = c(26100000, 60500000, 16200000, 30700000, 70100000, 57700000, 46700000, 8600000, 10000000, 61800000, 30200000, 52200000, 71900000, 55000000, 12700000 ), x = c(108000, 136000,
2006 Oct 19
2
How to get multiple Correlation Coefficients
Hi I have used a polycor package for categorical correlation coefficients. I run the following script. But there were no results. Could you tell me how to correct the script? Thanks in advance, vars <- names(sdi) for (i in 1:length(vars)) { for (j in 1:length(vars)) { paste(vars[i]," and ", vars[j]) polychor(vars[i], vars[j]) # corr } } -- Kum-Hoe Hwang, Ph.D.Phone :
2006 Nov 29
2
Dummies multiplied with other variable
Hi, I would like to estimate something like y = a + b*d2*y + c*d3*y where the dummies are created from some vector d with three (actually many more) levels using factor(). But either there is included the variable y or d1*y. How could I get rid of these? Example: x = c(1,2,3,4,5,6,7,8) y = c(3,6,2,8,7,6,2,4) d = c(1,1,1,2,3,2,3,3) fd = factor(d) lm(x ~ fd*y) gives: Coefficients: (Intercept)
2006 Sep 15
2
missing data codes
Dear all, I am new to R. I wish to use R's multiple imputation to deal with missing data. I have a data set with the size around 300 observations and 150 variables. I checked the help function in R and could not locate how to write the codes for this. can anyone give a hand? Do appreciate your time and kindness! Q. [[alternative HTML version deleted]]
2006 Sep 13
2
kendall's w
Hi, I try to calculate Kendall's W coefficient and I have a bizarre error. little.app.mat<-matrix(c(1,3,4,2,6,5,2,4,3,1,5,6,3,2,5,1,5,4),nrow=3,byrow=TRUE) print(kendall.w(little.app.mat[-1,])) >>> Kendall's W for ordinal data >>> W = 0.7753623Error in if (is.na(x$p.table)) { : argument is of length zero
2006 Sep 20
5
multiple lines and plot
Hi. Please, how can I put together 2 or more lines at the same scatterplot ? Example: measures of protein intake (quantitative) of 4 children over 30 days, by day. How to plot all children at same graphic: Protein X Time ? Is there any command like "overlay" ? Thank you, Mauricio
2006 Sep 14
1
time varying covariates
Hello, I am trying to model an intensity function with time-varying covariates. Before, I have successfully defined a log likelihood function for a Power-Law Process (lambda(t)=alpha*beta*t^(beta-1)) with two paramters and no covariates for a repairable systems with failure times (t). This function was maximized with R optim. No problem! But now I want to include a covariate indicating a
2006 Sep 20
2
Poission distribution
The expected number of bladder cancer over next 20 years a tire industry is 1.8. Poission distribution is assumed to hold and 6 reported deaths are caused by bladder cancer among the employees. Trying to find how unusual this event is. > ppois(q=6, lambda=1.8, lower.tail = TRUE, log.p = FALSE) [1] 0.9974306 not sure if ppois is the right one to use and the parameters... thx much
2006 Oct 24
2
colinearity?
I'm sorry to all those who are tired of seeing my email appear in need of help. But, I've never coded in any program before, so this has been a difficult process for me. Is there a simple function to test for colinearity in R? I'm running a logistic regression and a linear regression. Thanks for the help! [[alternative HTML version deleted]]
2006 Sep 12
2
(no subject)
Hi, I have a problem with aggregate. x <- aggregate(t1,list(t2,t3,t4), mean) z<-x[,3] I want z to be a vector but it is a factor. I've tried to use as.vector(z,mode="numeric") but then the numbers get scrambeled. Any help is appriciated /anders
2006 Sep 19
2
bubble plot problems
Hi, I'm having some problems with a bubble plot (ps package). I don't want tick marks on all four sides (just two), I want to have a smaller font size, and I would like to be able to define bubble sizes shown in the legend (now it shows 0, 0, 0, 9.747 and 4265.757 which is not really convenient. Passing some of the standard plot arguments didn't help (in fact, nothing changed).
2006 Sep 27
3
Converting text to numbers
Hi, I have Forecast Class and Observed Class in a data matrix as below. > Sample1 FCT OBS 1 1 5 2 2 4 3 3- 3+ 4 3 3 5 3+ 3- 6 4 2 7 5 1 I want to find the difference between Observed and Forecast Classes. How can I get this done? I tried to following to convert the 1 through 5 classes, to 1 through 7 for both OBS and FCT column. > Sample1$OBS2 <- Sample1$OBS
2007 Jan 20
3
Insert R logo
Dear all R users, I want to insert the R logo in every graphic that I made in my Statistical analysis using R. Can anyone tell me whether is it possible or not and if possible how to do this? your help will be highly appreciated. Thanks and Regards, Arun [[alternative HTML version deleted]]
2006 Dec 05
4
incidence and adjacency matrix conversion
Dear all, how can I convert an m x n incidence matrix into an m x m adjacency matrix or an n x n adjacency matrix? The current matrix contains binary data, hence the new matrix would contain counts of common occurrences. Thank you for your help. Phil
2012 Sep 24
11
76Gb to 146Gb
Hello all, I have a DL360 G4 1U server that does a wonderfull job with dovecot horde, Xmail and OpenLDAP for a company and serving about 40 acouunts. The machine is wonderful. I am very happy with it. However, I am running out of disk space. It has two times 76Gb Drives in RAID1 (disk mirroring) and the capacity has reached 82%.? I am starting of getting nervous. Does anyone know of a painless