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
0 Response to Weird breaking change in Stata 16 with views, cross() and column indexing
Post a Comment