hi
ı couldnt find any way to get rid of this problem. in R ı solved it with Y[j,1]<-sample(get(paste("X",j,"T", sep="")),1,replace=T)
but in stata ı couldnt find how to select an element randomly from a matrix and paste it to another matrix's element?
matrix X1 = (55\60\65\70\75)
mat Y = J(10, 1, .)
mat Y [1,1] = X1[.,1]
here ı want to put an any randomly element of X1 to first element of matris Y.
Related Posts with how to select any elements of a matrix randomly ?
Foreach and string variablesI have a panel data set with country, years, and the following three (relevant) variables: C (float…
Problem with hausman testIm using stata 12 and I have a result like this Code: . hausman fe re ---- Coef…
Help in dealing with messy longitudinal line graphGreetings, I'm running Stata 15.1 on OSX. Using data from the general social survey, I'm attempting…
Static (not dynamic) panel data using xtabond2.Dear All, This is a question more about econometric concept rather than Stata code. While (ssc insta…
Looping within a loopHello, I am using a panel dataset. It both id and ic variable (ic: income category: HI, LI, LMI, UMI…
Subscribe to:
Post Comments (Atom)
0 Response to how to select any elements of a matrix randomly ?
Post a Comment