Hello,
I am searching for a Stata expert to assist me with various academic research project. I am looking for someone to contuinuous work with. At times projects will be smaller (as this one) and at other times they may be much larger. Currently, I am using Stata but am interested (and may need to) also work with R and Matlab with future projects.
For this project, I want to automate my statistical analysis using stata. I am using panel data to run various different models and need at the end of each regression to create a few 2D and 3D graphs.
The solution should be based on a do script (do file) that uses the e() and r() matrixes to create the following:
1. the graphs as attached
2. a csv file consisting of the columns that can be used to create the graphs in external applications such as Matlab.
My Pseudo script for illsutration purposes: Of course, If you have a better solution, I am happy to learn about it
global f_ctrl_C f_age_l f_revt_l cnt_competitors_window_l f_RnDIntensity_l
global filter_C if !missing(f_RnDIntensity_l) & !missing(f_revt_l) & !missing(f_revt_l)
eststo: quietly xtregar $dv $iv $f_ctrl_C fsu_l fsu_lXavc $filter_C , rhotype(onestep) fe
// Start Creating graphs
// Note: DV and IV are defined for ranges between 0 and 1
matrix b = e(b)
matrix fitted = J(121,3,.) // create matrix that will hold predicted values
margins, atmeans post // get mean values for controls and store in matrix
matrix avg = e(at)
// now iterate through a range of data for which IV and Interaction are defined to create // a matrix of predicted values for the ranges specified in the "forvalues loop"
forvalues y = 0(0.1)1 { /z
forvalues x = 0(0.1)1 {
matrix fitted[i,1] = _b[_cons] + b[1,1]*avg[1,1] + + b[1,2]*avg[1,2 + ]... // here i need the predicted value given the coeficients and means of controls
matrix fitted[i,2] = `y'
matrix fitted[i,3] = `x'
}
}
// use matrix to cerate 3D graph
//export matrix to cvs file