Agriculture Reference
In-Depth Information
> estrsrs #output 1
total SE DEff
yobs 91655.711 2218.786 0.9891
as.factor(q1obs)1 259.600 42.031 1.0110
as.factor(q1obs)2 369.840 46.649 1.0271
as.factor(q1obs)3 370.560 46.608 1.0245
> vstrsrs < - svytotal(~as.factor(strataid),dstrsrs)
> vstrsrs #output 2
total SE
as.factor(strataid)11
258
0
as.factor(strataid)12
256
0
as.factor(strataid)21
248
0
as.factor(strataid)22
238
0
> domestrsrs1 < - svyby(~yobs,~q1obs,dstrsrs,svytotal)
> domestrsrs1 #output 3
q1obs
yobs
se
1
1 22516.85 3832.193
2
2 33998.00 4501.897
3
3 35140.85 4605.825
> domestrsrs2 < - svyby(~yobs,~strataid,dstrsrs,svytotal)
> domestrsrs2 #output 4
strataid
yobs
se
11
11 22321.31 1258.4635
12
12 23047.93
964.1853
21
21 24505.68
879.8666
22
22 21780.79 1278.8520
> set.seed(200694)
> kk < - as.numeric(sqrt(((framepop$xc-0.5)^2)+((framepop$yc-0.5)^2))
+
< 0.4)+1
> framepop < - cbind(framepop,strataid3 ¼ kk)
> str < - strata(framepop,"strataid3",size ¼ rep(50,2),method ¼ "srswor")
> str < - getdata(framepop,str)
> dstrsrs < - svydesign(id ¼ ~1,strata ¼ ~strataid3,data ¼ str,fpc ¼ ~Prob)
> estrsrs < - svytotal(~yobs+as.factor(q1obs),dstrsrs,,deff ¼ T)
> estrsrs #output 5
total
SE
DEff
yobs
91194.676
1191.471 0.3250
as.factor(q1obs)1
308.600
43.964 0.9965
as.factor(q1obs)2
380.000
46.536 1.0111
as.factor(q1obs)3
311.400
44.198 1.0021
Search WWH ::




Custom Search