NA and NaNs as the solution to my confidence interval equation

#I'm just learning Rstudio and I'm very confused anyone know what's going on?
#this is my function
ci.b.webostad <- function(beta, alpha){
t <- qt(1-(alpha/2), (length(data)-1))
sd <- sqrt(var(beta))
se <- sd/sqrt(length(data))
ci.u <- (beta)+tse
ci.l <- (beta)-t
se
cat("upper ci =", ci.u, " ")
cat("lower ci =", ci.l)
}
#this is the answer is gives me
ci.b.webostad(-.076, .01)
upper ci = NA lower ci = NA

The key is in the error message

Error in ci.b.webostad(-0.076, 0.01) : object 'tse' not found

Where is tse defined?

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.