please help me and correct why this program give me error?
bcos I want to apply the condition follow the attached below?
# program (R) used estimate beta of robust ridge (weighted stacklose)
? rm(list=ls())
? library(MASS)
? library(mvoutlier)
? library(robustbase)
? library(car)
? library(quantreg)
? n<-21
? p<-3
??
data<-read.csv('C:/Users/Kafi/Documents/stacklose.csv',header=TRUE)
???????????? cell<-data
????????????? y<-as.matrix(cell[,1])
????????????? x1<-cell[,2]
????????????? x2<-cell[,3]
????????????? x3<-cell[,4]
?stack<- as.matrix(data.frame(y,x1,x2,x3))
?stack
? d <- lm(y ~ x1+x2+x3)$residuals
? d1<-lm(y ~ x1+x2+x3)$fit
? d2<-abs(d)
? k<-4.685
? w<-NULL
?? for(i in 1:n){
?? if(d2<=k){w[i]=d{1-(d/k)^2}^2} else{w[i]=0}}
?? w
?
Kafi Dano Pati
Ph.D candidate ( mathematics/statistics)
Department of mathematical Science/ faculty of Science
University Technology Malaysia
81310 UTM, Johor Bahru, Johor, Malaysia
IC. NO. 201202F10234
Matric No. PS113113
HP. No.?00601117517559
E-mail: kafi_dano at yahoo.com
supervisor- Assoc. Prof. Robiah Binti Adnan