Hi R users:

I am applying the package plm to some high-frequency financial data for panel data analysis. Listed below is my coding and error message:

rm(list=ls())
library("plm")
toydata <- read.csv("D:/............./toydata.csv",header=TRUE,sep = ",");
summary(toydata)
# toydata <- pdata.frame(toydata, index = c("SECCODE", "TDATE"), drop.index = TRUE, row.names = TRUE)
 
# estimation of the error components
toydata.out <- plm(data=toydata, RETURN ~ IOB + IOBS, random.method="walhus", effect="twoways", model='random')

ERROR MESSAGE:
duplicate couples (time-id)
error in pdim.default(index[[1]], index[[2]]) :
 
Please help and advise what I should do to fix this problem about index. Do I need to pre-process the data or else? 

Thanks for your kind attention.

Wei-han

toydat has the following format:
SECCODE  SECNAME  TDATE TTIME  OPNPRC  LASTCLOSE  HIPRC  LOPRC  BUY_PRICE  SELL_PRICE  M_PRICE  [RETURN]  BUY_VOLUME  SELL_VOLUME  BUY_AMOUNT  SELL_AMOUNT  T_BV1 T_SV1 T_BV T_SV Nshrtrd Nvaltrd IOB IOBS 
1 ABC 20091009 930 20.5 20.01 20.5 20.5 20.01 20.01 20.01 0 0 0 0 0 0 0 0 0 274350 5624175 0 0 
1 ABC 20091009 1130 20.5 20.01 20.89 20.23 20.64 20.63 20.64 3.148 6202040 5717533 1.28E+08 1.18E+08 17220770 13731545 87541915 1.58E+08 11919973 2.46E+08 -484507 -1E+07 
1 ABC 20091009 1500 20.5 20.01 21.15 20.75 20.96 20.97 20.97 1.599 7973683 5226993 1.67E+08 1.1E+08 26412130 25795134 1.04E+08 4.32E+08 13552010 2.84E+08 -2746690 -5.8E+07 
	[[alternative HTML version deleted]]

