||When using marginal models to analyse longitudinal or clustered data, the estimation methods based on each marginal model are often readily available. However, combining them to obtain a more accurate or possibly optimal estimate under certain criterion, could be difficult. The main reason is that the objective functions based on marginal models may be not differentiable. Moreover, the estimating functions based on marginal models might have variances that are difficult to compute or approximate, preventing the direct use of the method of generalized estimating equations. To circumvent these difficulties, a random weighting method is proposed to use. A general theorem on validity of random weighting method is given and an example that bootstrap fails to consistently estimate the estimator's variance but random weighting does is provided. The main advantage of this approach is that it is computationally straightforward even when no particular structure of dependence among marginal models is available. The resulting estimator achieves certain optimality in terms of asymptotic variance. We illustrate the method with median regression, Mann-Whitney-Gehan's estimation, Buckely-James estimation and multivariate proportional hazards model as examples. Supportive empirical evidence is shown in the simulation studies. Application is illustrated with a well-known medical study.