Infering missing population's sex I have a dataset with the following characteristics:

*

*Total number of samples: 319 813

*Sample percentage of people not declaring their gender:  0.57

*Sample percentage of people declared as Female:  0.38

*Sample percentage of people declared as Male:  0.02

*Sample percentage of people declaring Other: 0.021635

This database is from a country where the percentage of females is 51%
With those statistics, can we infer with some confidence what is the distribution of sex for the population that didn't declare?
If so, what is the methodology to apply? Or do we need more information to be able to do so?

Whether or not you can make the inference you are proposing really depends on the sampling method used to get that sample.  If the sample were to have been formed by a process like simple-random-sampling, and assuming the sampling frame was reflective of the true population (i.e., also 51% female) then you would indeed have a good basis for inferring the sex proportions in the undeclared part of the population.  However, before making this kind of inference you should carefully scrutinise the sampling method to see if it could have produced significantly different proportions of males and females from the host population.
Even so, it is not really clear how this would help you; if you are making an inference about sex proportions then you evidently already have the true sex proportion in the population, and if you are making an inference about some other variable then it may be difficult to infer how sex relates to that variable of interest in the undeclared group (even if you can infer the sex proportion in the undeclared group).
