8
8
# ' @family functions to extract from a GPPM
9
9
# ' @return Point estimates for all parameters as a named numeric vector.
10
10
# ' @examples
11
- # ' data("exampleModel")
12
- # ' paraEsts <- coef(exampleModel)
11
+ # ' \dontrun{
12
+ # ' data("demoLGCM")
13
+ # ' lgcm <- gppm('muI+muS*t','varI+covIS*(t+t#)+varS*t*t#+(t==t#)*sigma',
14
+ # ' demoLGCM,'ID','y')
15
+ # ' lgcmFit <- fit(lgcm)
16
+ # ' paraEsts <- coef(lgcmFit)
17
+ # ' }
13
18
# ' @export
14
19
coef.GPPM <- function (object ,... ){
15
20
checkFitted(object )
@@ -24,8 +29,13 @@ coef.GPPM <- function (object,...){
24
29
# ' @family functions to extract from a GPPM
25
30
# ' @return A matrix of the estimated covariances between the parameter estimates. This has row and column names corresponding to the parameter names.
26
31
# ' @examples
27
- # ' data("exampleModel")
28
- # ' covMat <- vcov(exampleModel)
32
+ # ' \dontrun{
33
+ # ' data("demoLGCM")
34
+ # ' lgcm <- gppm('muI+muS*t','varI+covIS*(t+t#)+varS*t*t#+(t==t#)*sigma',
35
+ # ' demoLGCM,'ID','y')
36
+ # ' lgcmFit <- fit(lgcm)
37
+ # ' covMat <- vcov(lgcmFit)
38
+ # ' }
29
39
# ' @export
30
40
vcov.GPPM <- function (object ,... )
31
41
{
@@ -42,8 +52,12 @@ vcov.GPPM <- function (object,...)
42
52
# ' @family functions to extract from a GPPM
43
53
# ' @return Standard errors for all parameters as a named numeric vector.
44
54
# ' @examples
45
- # ' data("exampleModel")
46
- # ' stdErrors <- SE(exampleModel)
55
+ # ' \dontrun{
56
+ # ' lgcm <- gppm('muI+muS*t','varI+covIS*(t+t#)+varS*t*t#+(t==t#)*sigma',
57
+ # ' demoLGCM,'ID','y')
58
+ # ' lgcmFit <- fit(lgcm)
59
+ # ' stdErrors <- SE(lgcmFit)
60
+ # ' }
47
61
# ' @export
48
62
SE <- function (object )
49
63
{
@@ -63,8 +77,13 @@ SE <- function (object)
63
77
# '
64
78
# ' @return A matrix (or vector) with columns giving lower and upper confidence limits for each parameter. These will be labelled as (1-level)/2 and 1 - (1-level)/2 in \% (by default 2.5\% and 97.5\%).
65
79
# ' @examples
66
- # ' data("exampleModel")
67
- # ' confInts <- confint(exampleModel)
80
+ # ' \dontrun{
81
+ # ' data("demoLGCM")
82
+ # ' lgcm <- gppm('muI+muS*t','varI+covIS*(t+t#)+varS*t*t#+(t==t#)*sigma',
83
+ # ' demoLGCM,'ID','y')
84
+ # ' lgcmFit <- fit(lgcm)
85
+ # ' confInts <- confint(lgcmFit)
86
+ # ' }
68
87
# ' @export
69
88
confint.GPPM <- function (object , parm , level = 0.95 ,... )
70
89
{
@@ -94,8 +113,13 @@ confint.GPPM <- function(object, parm, level = 0.95,...)
94
113
# ' @family functions to extract from a GPPM
95
114
# ' @return Returns an object of class logLik. Attributs are: "df" (\strong{d}egrees of \strong{f}reedom; number of estimated parameters in the model) and nobs (number of persons in the model)
96
115
# ' @examples
97
- # ' data("exampleModel")
98
- # ' ll <- logLik(exampleModel)
116
+ # ' \dontrun{
117
+ # ' data("demoLGCM")
118
+ # ' lgcm <- gppm('muI+muS*t','varI+covIS*(t+t#)+varS*t*t#+(t==t#)*sigma',
119
+ # ' demoLGCM,'ID','y')
120
+ # ' lgcmFit <- fit(lgcm)
121
+ # ' ll <- logLik(lgcmFit)
122
+ # ' }
99
123
# ' @export
100
124
logLik.GPPM <- function (object ,... ){
101
125
checkFitted(object )
@@ -113,12 +137,17 @@ logLik.GPPM <- function(object,...){
113
137
# ' @family functions to extract from a GPPM
114
138
# ' @return Returns a list structure with mean and covariances matrices. See example.
115
139
# ' @examples
116
- # ' data("exampleModel")
117
- # ' meansCovs <- fitted(exampleModel)
140
+ # ' \dontrun{
141
+ # ' data("demoLGCM")
142
+ # ' lgcm <- gppm('muI+muS*t','varI+covIS*(t+t#)+varS*t*t#+(t==t#)*sigma',
143
+ # ' demoLGCM,'ID','y')
144
+ # ' lgcmFit <- fit(lgcm)
145
+ # ' meansCovs <- fitted(lgcmFit)
118
146
# '
119
147
# ' person1Mean <- meansCovs$mean[[1]]
120
148
# ' person1Cov <- meansCovs$cov[[1]]
121
149
# ' person1ID <- meansCovs$ID[[1]]
150
+ # ' }
122
151
# ' @export
123
152
fitted.GPPM <- function (object ,... ){
124
153
checkFitted(object )
@@ -133,8 +162,12 @@ fitted.GPPM <- function(object,...){
133
162
# ' @param gpModel object of class GPPM.
134
163
# ' @return Number of persons as a numeric.
135
164
# ' @examples
136
- # ' data("exampleModel")
137
- # ' numberPersons <- nPers(exampleModel)
165
+ # ' \dontrun{
166
+ # ' data("demoLGCM")
167
+ # ' lgcm <- gppm('muI+muS*t','varI+covIS*(t+t#)+varS*t*t#+(t==t#)*sigma',
168
+ # ' demoLGCM,'ID','y')
169
+ # ' numberPersons <- nPers(lgcm)
170
+ # ' }
138
171
# ' @export
139
172
nPers <- function (gpModel ) {
140
173
gpModel $ dataForStan $ nPer
@@ -150,8 +183,12 @@ nPers <- function (gpModel) {
150
183
# ' @family functions to extract from a GPPM
151
184
# ' @return Number of parameters as a numeric.
152
185
# ' @examples
153
- # ' data("exampleModel")
154
- # ' numberParas <- nPars(exampleModel)
186
+ # ' \dontrun{
187
+ # ' data("demoLGCM")
188
+ # ' lgcm <- gppm('muI+muS*t','varI+covIS*(t+t#)+varS*t*t#+(t==t#)*sigma',
189
+ # ' demoLGCM,'ID','y')
190
+ # ' numberParas <- nPars(lgcm)
191
+ # ' }
155
192
# ' @export
156
193
nPars <- function (gpModel ) {
157
194
checkGPPM(gpModel )
@@ -167,8 +204,12 @@ nPars <- function (gpModel) {
167
204
# ' @family functions to extract from a GPPM
168
205
# ' @return Maximum number of observations as a numeric.
169
206
# ' @examples
170
- # ' data("exampleModel")
171
- # ' maxNumberObs <- maxnObs(exampleModel)
207
+ # ' \dontrun{
208
+ # ' data("demoLGCM")
209
+ # ' lgcm <- gppm('muI+muS*t','varI+covIS*(t+t#)+varS*t*t#+(t==t#)*sigma',
210
+ # ' demoLGCM,'ID','y')
211
+ # ' maxNumberObs <- maxnObs(lgcm)
212
+ # ' }
172
213
# ' @export
173
214
maxnObs <- function (gpModel ){
174
215
checkGPPM(gpModel )
@@ -183,9 +224,12 @@ maxnObs <- function (gpModel){
183
224
# ' @family functions to extract from a GPPM
184
225
# ' @return Number of observations for each person as a numeric vector. The corresponding IDs are in the IDs attribute.
185
226
# ' @examples
186
- # ' data("exampleModel")
187
- # ' numberObs <- nObs(exampleModel)
188
- # '
227
+ # ' \dontrun{
228
+ # ' data("demoLGCM")
229
+ # ' lgcm <- gppm('muI+muS*t','varI+covIS*(t+t#)+varS*t*t#+(t==t#)*sigma',
230
+ # ' demoLGCM,'ID','y')
231
+ # ' numberObs <- nObs(lgcm)
232
+ # ' }
189
233
# ' @export
190
234
nObs <- function (gpModel ) {
191
235
checkGPPM(gpModel )
@@ -205,8 +249,12 @@ nObs <- function (gpModel) {
205
249
# ' @family functions to extract from a GPPM
206
250
# ' @return Number of predictors as numeric.
207
251
# ' @examples
208
- # ' data("exampleModel")
209
- # ' numberPreds <- nPreds(exampleModel)
252
+ # ' \dontrun{
253
+ # ' data("demoLGCM")
254
+ # ' lgcm <- gppm('muI+muS*t','varI+covIS*(t+t#)+varS*t*t#+(t==t#)*sigma',
255
+ # ' demoLGCM,'ID','y')
256
+ # ' numberPreds <- nPreds(lgcm)
257
+ # ' }
210
258
# ' @export
211
259
nPreds <- function (gpModel ) {
212
260
checkGPPM(gpModel )
@@ -221,8 +269,12 @@ nPreds <- function (gpModel) {
221
269
# ' @family functions to extract from a GPPM
222
270
# ' @return The names of the predictors.
223
271
# ' @examples
224
- # ' data("exampleModel")
225
- # ' myPreds <- preds(exampleModel)
272
+ # ' \dontrun{
273
+ # ' data("demoLGCM")
274
+ # ' lgcm <- gppm('muI+muS*t','varI+covIS*(t+t#)+varS*t*t#+(t==t#)*sigma',
275
+ # ' demoLGCM,'ID','y')
276
+ # ' myPreds <- preds(lgcm)
277
+ # ' }
226
278
# ' @export
227
279
preds <- function (gpModel ) {
228
280
checkGPPM(gpModel )
@@ -237,9 +289,13 @@ preds <- function(gpModel) {
237
289
# ' @inheritParams nPers
238
290
# ' @family functions to extract from a GPPM
239
291
# ' @examples
240
- # ' data("exampleModel")
241
- # ' parameters <- pars(exampleModel)
292
+ # ' \dontrun{
293
+ # ' data("demoLGCM")
294
+ # ' lgcm <- gppm('muI+muS*t','varI+covIS*(t+t#)+varS*t*t#+(t==t#)*sigma',
295
+ # ' demoLGCM,'ID','y')
296
+ # ' parameters <- pars(lgcm)
242
297
# ' @return The names of the paramters
298
+ # ' }
243
299
# ' @export
244
300
pars <- function (gpModel ) {
245
301
gpModel $ parsedModel $ params
@@ -254,9 +310,13 @@ pars <- function (gpModel) {
254
310
# ' @family functions to extract from a GPPM
255
311
# ' @param level scalar from 0 to 1. The confidence level required.
256
312
# ' @examples
257
- # ' data("exampleModel")
258
- # ' paramEssentials <- parEsts(exampleModel)
259
- # '
313
+ # ' \dontrun{
314
+ # ' data("demoLGCM")
315
+ # ' lgcm <- gppm('muI+muS*t','varI+covIS*(t+t#)+varS*t*t#+(t==t#)*sigma',
316
+ # ' demoLGCM,'ID','y')
317
+ # ' lgcmFit <- fit(lgcm)
318
+ # ' paramEssentials <- parEsts(lgcmFit)
319
+ # ' }
260
320
# ' @return A data.frame containing the estimated parameters, standard errors, and the lower and upper bounds of the confidence intervals.
261
321
# ' @export
262
322
parEsts <- function (object , level = .95 ) {
@@ -286,8 +346,12 @@ parEsts <- function (object, level=.95) {
286
346
# ' @family functions to extract from a GPPM
287
347
# ' @return The mean function as a character string.
288
348
# ' @examples
289
- # ' data("exampleModel")
290
- # ' myMean <- meanf(exampleModel)
349
+ # ' \dontrun{
350
+ # ' data("demoLGCM")
351
+ # ' lgcm <- gppm('muI+muS*t','varI+covIS*(t+t#)+varS*t*t#+(t==t#)*sigma',
352
+ # ' demoLGCM,'ID','y')
353
+ # ' myMean <- meanf(lgcm)
354
+ # ' }
291
355
# ' @export
292
356
meanf <- function (gpModel ) {
293
357
checkGPPM(gpModel )
@@ -303,8 +367,12 @@ meanf <- function (gpModel) {
303
367
# ' @family functions to extract from a GPPM
304
368
# ' @return The covariance function as a character string.
305
369
# ' @examples
306
- # ' data("exampleModel")
307
- # ' myCov <- covf(exampleModel)
370
+ # ' \dontrun{
371
+ # ' data("demoLGCM")
372
+ # ' lgcm <- gppm('muI+muS*t','varI+covIS*(t+t#)+varS*t*t#+(t==t#)*sigma',
373
+ # ' demoLGCM,'ID','y')
374
+ # ' myCov <- covf(lgcm)
375
+ # ' }
308
376
# ' @export
309
377
covf <- function (gpModel ) {
310
378
checkGPPM(gpModel )
@@ -320,8 +388,12 @@ covf <- function (gpModel) {
320
388
# ' @family functions to extract from a GPPM
321
389
# ' @return The data set associated with the GPPM.
322
390
# ' @examples
323
- # ' data("exampleModel")
324
- # ' myData <- datas(exampleModel)
391
+ # ' \dontrun{
392
+ # ' data("demoLGCM")
393
+ # ' lgcm <- gppm('muI+muS*t','varI+covIS*(t+t#)+varS*t*t#+(t==t#)*sigma',
394
+ # ' demoLGCM,'ID','y')
395
+ # ' myData <- datas(lgcm)
396
+ # ' }
325
397
# ' @export
326
398
datas <- function (gpModel ) {
327
399
checkGPPM(gpModel )
@@ -345,8 +417,13 @@ datas <- function (gpModel) {
345
417
# ' @family functions to extract from a GPPM
346
418
# ' @return The requested quantity
347
419
# ' @examples
348
- # ' data("exampleModel")
349
- # ' getIntern(exampleModel,'parsedmFormula')
420
+ # ' \dontrun{
421
+ # ' data("demoLGCM")
422
+ # ' lgcm <- gppm('muI+muS*t','varI+covIS*(t+t#)+varS*t*t#+(t==t#)*sigma',
423
+ # ' demoLGCM,'ID','y')
424
+ # ' lgcmFit <- fit(lgcm)
425
+ # ' getIntern(lgcmFit,'parsedmFormula')
426
+ # ' }
350
427
# ' @export
351
428
getIntern <- function (gpModel , quantity ) {
352
429
checkGPPM(gpModel )
0 commit comments