My package `elasticregress` has stopped working in Stata 16. I think the below code illustrates what has broken/changed:
Note that the problem has something to do with the weights being loaded into a view. When I delete the st_view line, there is no problem.
Code:
// Create ten observations with a weight variable clear set obs 10 generate weight = 1 mata: // In Mata, create an x vector and load the weights into a view. x = J(10,1,1) w = J(10,1,1) st_view(w, ., "weight") // The next two displays should be equivalent, but they are not. The first // returns 10 while the second returns a missing value. x_new = x[,1] display(strofreal(cross(x_new, w, x_new))) display(strofreal(cross(x[,1], w, x[,1]))) end
Comment