how to begin my analysis? panel data, lots of missingness, and around 100 variables I have an extremely unbalanced panel dataset over ten time periods， with a large percentage of missingness, and a high number of mixed types variables and the dependent variable is binary. I want to ask:
1. how to select independent variables across the time period? 
2. how to deal with missingness? some of the variables with over 90% missingness
3. which goes first? Variables selection or imputation?
finally, the software I can use is STATA SAS and R, but R is just beginner level.
Thanks 
 A: Interesting first question but why couldn't you have been given a less complicated problem? Your query has no easy answers, much less hard and fast cookbook rules, and such answers as do exist are not for the unsophisticated. That said, CV is not intended to be a resource for software-specific questions so don't expect responses to include recommendations wrt your concerns about R or Stata.
Issues wrt missing data have seen decades of literature and research probably beginning with Little and Rubin's book Statistical Analysis with Missing Data. The key thing is to identify the mechanism(s) underlying the missingness, e.g., is it missing at random (MAR), missing completely at random (MCAR), ignorable, nonignorable, and so on. These topics have been well developed (e.g., this Wiki article https://en.wikipedia.org/wiki/Missing_data offers a good stake-in-the-ground but my go-to reference is Paul Allison's thoughtful, highly readable, more than 15 year old Sage book Missing Data). Depending on the mechanism, imputation may provide more or less representative (unbiased) results. If the missingness is nonignorable and/or systematic then there are no good options or solutions. 
You don't indicate whether or not the missing values are in the dependent variable (left hand side of the equation) or the independent predictors (right hand side). One useful rule of thumb is that imputation wrt the DV is not recommended. Unfortunately there are no conventions, norms or rules of thumb wrt how much missingness in the predictors is too much. Such decisions are always left to the analyst. My experience is that anything north of 50% missing begins to make me squeamish. 
To answer your question, imputation should precede selection. The next decision concerns which imputation method should be used. As outlined in the Wiki piece there are many approaches to plugging missing values. In an ASA short course, Rubin gave a few helpful hints about this process. Among the most easily implemented solutions for continuously distributed information is to plug missing values with the mean or the median -- an approach that in Rubin's view was definitely a bad idea as it will result in a spike in the pdf of the variable's distribution at that value. Out of all the options, his view was that the least biasing was model-based multiple imputation and suggests the standard approach of evaluating the extent to which the results of the process of imputation are good by comparing summary statistics of the before and after imputed variables. Large differences or deviations between the unplugged and plugged statistics are not desirable. 
Other suggestions made by Rubin included:


*

*Using the DV as a predictor in model-based imputation

*When there are multiple variables with missing data (as in your case) rank them from least to most wrt the proportion of missing information and begin the process of imputation with variables containing the least missing data

*Once plugged use these variables as predictors for imputation wrt variables lower down the list
Finally, variable selection is one of those topics about which every statistician and their brother has an opinion and published paper. One method is the lasso which the author of the (now shuttered) Normal Deviate blog ranked as one of the top 10 statistical innovations of the recent era.
