• R语言
  • 求助怎么用R 编码要怎么写?分析得出平均值和标准差

比如数据

The data are taken from the survey “Generation” which is a sample of young people leaving the education system in 1998. Retrospective information was acquired in 2001 and then again in 2003. The objective of this project is to analyze the impact of military service on labour market outcomes. As of 1997, the obligatory military service was changed. For those born after January 1979, obligatory military service was abolished. Thus among those leaving the education system in the year 1998, some will have been required to do military service and others not. Among those born before January 1979, some young men were exempt from military service (for various reasons relating to health etc).

wage: wage in first job after leaving education

parents: = 1 if both parents are French, = 0 otherwise rural1: = 1 lives in a rural area, = 0 otherwise

iledf: =1 lives in Paris region, = 0 otherwise female: =1 if female, = 0 if male

Analyze of the impact of military service on the logarithm of subsequent earnings in

the first job obtained after military service.

military: =1 if military service undertaken, = 0 otherwise

niveau : = 6 no secondary diploma, = 5 secondary diploma, = 4 baccalaureat

born1979: = 1 born after Januray 1st 1979,

用R 要怎么写编码来得到平均值和标准差

wage parents iledf military niveau born1979

1209 1 0 0 0 1

908 1 1 1 0 0

1101 0 0 0 0 1

890 0 1 1 0 0

比如要求得miitary 参数为1的工资平均值和标准差该怎么写代码。

然后military参数为1 born1979的参数也为1 时候 工资的平均值和标准差