search for: hbr_intercept

Displaying 1 result from an estimated 1 matches for "hbr_intercept".

Did you mean: clr_intercept
2018 May 08
4
Average of results coming from B=100 repetitions (looping)
...looping) for(i in 1?:100) { # randomize sampling seed n=dim(BIO)[1] p=0.667 # Sample size sam=sample(1 :n,floor(p*n),replace=FALSE) # Sample training data Training =BIO [sam,] # Sample testing data Testing = BIO [-sam,] # Build the HBR model HBR<-hbrfit(D ~ A+B) # Grab the coefficients HBR_intercept <- as.numeric(HBR$coefficients[1]) HBR_coefA <- as.numeric(HBR$coefficients[2]) HBR_coefB <- as.numeric(HBR$coefficients[3]) # Predict response on testing data Testing$pred <- HBR_intercept + HBR_coefA * Testing$A + HBR_coefB *Testing$B # Get errors Testing$sq_error <- (Testing$D...